[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:
mjagdis
2026-01-02 15:38:44 +01:00
committed by GitHub
parent c75f3e5acf
commit 090b010921
@@ -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();