Skip to content

Commit

Permalink
[zoneminder] Only update state options if they've changed (openhab#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 authored and Nemer_Daud committed Jan 28, 2022
1 parent 5c6a46f commit d6e139b
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 d6e139b

Please sign in to comment.