[somfytahoma] Ignore disabled things (#12687)

* [somfytahoma] Ignore disabled things

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
This commit is contained in:
lolodomo 2022-05-05 20:13:59 +02:00 committed by GitHub
parent bfca6d2201
commit b4945f647c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 3 deletions

View File

@ -451,7 +451,7 @@ public class SomfyTahomaBridgeHandler extends BaseBridgeHandler {
boolean needsUpdate = reconciliation;
for (Thing th : getThing().getThings()) {
if (ThingStatus.ONLINE != th.getStatus()) {
if (th.isEnabled() && ThingStatus.ONLINE != th.getStatus()) {
needsUpdate = true;
}
}
@ -519,7 +519,7 @@ public class SomfyTahomaBridgeHandler extends BaseBridgeHandler {
private void processGatewayEvent(SomfyTahomaEvent event) {
// update gateway status
for (Thing th : getThing().getThings()) {
if (THING_TYPE_GATEWAY.equals(th.getThingTypeUID())) {
if (th.isEnabled() && THING_TYPE_GATEWAY.equals(th.getThingTypeUID())) {
SomfyTahomaGatewayHandler gatewayHandler = (SomfyTahomaGatewayHandler) th.getHandler();
if (gatewayHandler != null && gatewayHandler.getGateWayId().equals(event.getGatewayId())) {
gatewayHandler.refresh(STATUS);
@ -567,7 +567,7 @@ public class SomfyTahomaBridgeHandler extends BaseBridgeHandler {
handler.updateThingChannels(states);
}
} else {
logger.debug("Thing handler is null, probably not bound thing.");
logger.debug("Thing is disabled or handler is null, probably not bound thing.");
}
}
@ -588,6 +588,9 @@ public class SomfyTahomaBridgeHandler extends BaseBridgeHandler {
private @Nullable Thing getThingByDeviceUrl(String deviceUrl) {
for (Thing th : getThing().getThings()) {
if (!th.isEnabled()) {
continue;
}
String url = (String) th.getConfiguration().get("url");
if (deviceUrl.equals(url)) {
return th;