Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[somfytahoma] Ignore disabled things #12687

Merged
merged 2 commits into from
May 5, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ private synchronized void updateThings() {
boolean needsUpdate = reconciliation;

for (Thing th : getThing().getThings()) {
if (ThingStatus.ONLINE != th.getStatus()) {
if (th.isEnabled() && ThingStatus.ONLINE != th.getStatus()) {
needsUpdate = true;
}
}
Expand Down Expand Up @@ -519,7 +519,7 @@ private void unregisterExecution(String execId) {
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);
Expand Down Expand Up @@ -567,7 +567,7 @@ private void processStateChangedEvent(SomfyTahomaEvent event) {
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.");
}
}

Expand All @@ -588,6 +588,9 @@ private void refreshTahomaStates() {

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;
Expand Down