From edd3e01c64f0b2827950ed255f1f6ea7e61db5ae Mon Sep 17 00:00:00 2001 From: Mark Hilbush Date: Sun, 31 Oct 2021 06:12:22 -0400 Subject: [PATCH] [zoneminder] Only update state options if they've changed (#11463) * Only update state options if they've changed Signed-off-by: Mark Hilbush * Fix update of state options Signed-off-by: Mark Hilbush --- .../zoneminder/internal/handler/ZmBridgeHandler.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZmBridgeHandler.java b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZmBridgeHandler.java index 4fd9a2362e9e5..5e31c7df003ac 100644 --- a/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZmBridgeHandler.java +++ b/bundles/org.openhab.binding.zoneminder/src/main/java/org/openhab/binding/zoneminder/internal/handler/ZmBridgeHandler.java @@ -318,11 +318,12 @@ private synchronized List 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 ids = monitorHandlers.keySet(); for (Monitor m : monitorList) {