[orbitbhyve] do not update status of a disabled sprinker (#12679)

Signed-off-by: Ondrej Pecta <opecta@gmail.com>
This commit is contained in:
Ondrej Pecta 2022-05-04 12:54:20 +02:00 committed by GitHub
parent cc3ebeffdd
commit a37a119ff1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -308,11 +308,13 @@ public class OrbitBhyveBridgeHandler extends ConfigStatusBridgeHandler {
private void updateAllStatuses() {
List<OrbitBhyveDevice> devices = getDevices();
for (Thing th : getThing().getThings()) {
String deviceId = th.getUID().getId();
OrbitBhyveSprinklerHandler handler = (OrbitBhyveSprinklerHandler) th.getHandler();
for (OrbitBhyveDevice device : devices) {
if (deviceId.equals(th.getUID().getId())) {
updateDeviceStatus(device, handler);
if (th.isEnabled()) {
String deviceId = th.getUID().getId();
OrbitBhyveSprinklerHandler handler = (OrbitBhyveSprinklerHandler) th.getHandler();
for (OrbitBhyveDevice device : devices) {
if (deviceId.equals(th.getUID().getId())) {
updateDeviceStatus(device, handler);
}
}
}
}