[zoneminder] Only update state options if they've changed (#11463)

* Only update state options if they've changed

Signed-off-by: Mark Hilbush <mark@hilbush.com>

* Fix update of state options

Signed-off-by: Mark Hilbush <mark@hilbush.com>
This commit is contained in:
Mark Hilbush 2021-10-31 06:12:22 -04:00 committed by GitHub
parent 28fb126754
commit edd3e01c64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -318,11 +318,12 @@ public class ZmBridgeHandler extends BaseBridgeHandler {
monitorList.add(monitor);
options.add(new StateOption(monitorDTO.id, "Monitor " + monitorDTO.id));
}
stateDescriptionProvider
.setStateOptions(new ChannelUID(getThing().getUID(), CHANNEL_IMAGE_MONITOR_ID), options);
stateDescriptionProvider
.setStateOptions(new ChannelUID(getThing().getUID(), CHANNEL_VIDEO_MONITOR_ID), options);
}
// Update state options
stateDescriptionProvider.setStateOptions(new ChannelUID(getThing().getUID(), CHANNEL_IMAGE_MONITOR_ID),
options);
stateDescriptionProvider.setStateOptions(new ChannelUID(getThing().getUID(), CHANNEL_VIDEO_MONITOR_ID),
options);
// Only update alarm and event info for monitors whose handlers are initialized
Set<String> ids = monitorHandlers.keySet();
for (Monitor m : monitorList) {