mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
Fix handling of multiple sprinklers (#16630)
Signed-off-by: Mark Hilbush <mark@hilbush.com> Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
This commit is contained in:
parent
e0cf6777d5
commit
b9fb88a023
@ -321,11 +321,11 @@ public class OrbitBhyveBridgeHandler extends ConfigStatusBridgeHandler {
|
||||
List<OrbitBhyveDevice> devices = getDevices();
|
||||
for (Thing th : getThing().getThings()) {
|
||||
if (th.isEnabled()) {
|
||||
String deviceId = th.getUID().getId();
|
||||
ThingHandler handler = th.getHandler();
|
||||
if (handler instanceof OrbitBhyveSprinklerHandler sprinklerHandler) {
|
||||
String deviceId = sprinklerHandler.getSprinklerId();
|
||||
for (OrbitBhyveDevice device : devices) {
|
||||
if (deviceId.equals(th.getUID().getId())) {
|
||||
if (deviceId.equals(device.getId())) {
|
||||
updateDeviceStatus(device, sprinklerHandler);
|
||||
}
|
||||
}
|
||||
@ -345,9 +345,9 @@ public class OrbitBhyveBridgeHandler extends ConfigStatusBridgeHandler {
|
||||
|
||||
private void updateDeviceStatus(String deviceId) {
|
||||
for (Thing th : getThing().getThings()) {
|
||||
if (deviceId.equals(th.getUID().getId())) {
|
||||
ThingHandler handler = th.getHandler();
|
||||
if (handler instanceof OrbitBhyveSprinklerHandler sprinklerHandler) {
|
||||
if (deviceId.equals(sprinklerHandler.getSprinklerId())) {
|
||||
OrbitBhyveDevice device = getDevice(deviceId);
|
||||
updateDeviceStatus(device, sprinklerHandler);
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ public class OrbitBhyveSprinklerHandler extends BaseThingHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private String getSprinklerId() {
|
||||
public String getSprinklerId() {
|
||||
return getThing().getConfiguration().get("id") != null ? getThing().getConfiguration().get("id").toString()
|
||||
: "";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user