mirror of
https://github.com/danieldemus/openhab-addons
synced 2026-07-29 12:34:21 +02:00
[tuya] Avoid refresh if there are no measurables (#19930)
* [tuya] Avoid refresh if there are no measurables Signed-off-by: Mike Jagdis <mjagdis@eris-associates.co.uk>
This commit is contained in:
+12
@@ -562,6 +562,18 @@ public class TuyaDeviceHandler extends BaseThingHandler implements DeviceInfoSub
|
||||
public void initialize() {
|
||||
configuration = getConfigAs(DeviceConfiguration.class);
|
||||
|
||||
boolean hasStatusDps = false;
|
||||
for (var e : schemaDps.values()) {
|
||||
if (e.readOnly) {
|
||||
hasStatusDps = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!hasStatusDps) {
|
||||
logger.debug("{}: no status DPs - polling disabled", thing.getUID().getId());
|
||||
configuration.pollingInterval = 0;
|
||||
}
|
||||
|
||||
// check if we have channels and add them if available
|
||||
if (thing.getChannels().isEmpty()) {
|
||||
addChannels();
|
||||
|
||||
Reference in New Issue
Block a user