Skip to content

Commit

Permalink
[zoneminder] Only update state options if they've changed (#11463)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
mhilbush committed Oct 31, 2021
1 parent 28fb126 commit edd3e01
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,12 @@ private synchronized List<Monitor> getMonitors() {
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) {
Expand Down

0 comments on commit edd3e01

Please sign in to comment.