From ff873fff14fcd0489d7706b7149155a37ad5e44e Mon Sep 17 00:00:00 2001 From: David Pace Date: Mon, 20 Nov 2023 20:59:52 +0100 Subject: [PATCH] [boschshc] Update active profile of intrusion detection system (#15899) * [boschshc] Update active profile of intrusion detection system Fixes an issue that caused the active configuration profile of the intrusion detection system not to be updated. closes #15848 * [boschshc] add channel to control state service registration Signed-off-by: David Pace --- .../internal/devices/intrusion/IntrusionDetectionHandler.java | 3 ++- .../devices/intrusion/IntrusionDetectionHandlerTest.java | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/intrusion/IntrusionDetectionHandler.java b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/intrusion/IntrusionDetectionHandler.java index 8941c8db1..a8c5a49c2 100644 --- a/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/intrusion/IntrusionDetectionHandler.java +++ b/bundles/org.openhab.binding.boschshc/src/main/java/org/openhab/binding/boschshc/internal/devices/intrusion/IntrusionDetectionHandler.java @@ -93,7 +93,7 @@ public class IntrusionDetectionHandler extends BoschSHCHandler { CHANNEL_ACTIVE_CONFIGURATION_PROFILE), true); this.registerService(intrusionDetectionControlStateService, this::updateChannels, - List.of(CHANNEL_ARMING_STATE)); + List.of(CHANNEL_ARMING_STATE, CHANNEL_ACTIVE_CONFIGURATION_PROFILE)); this.registerService(surveillanceAlarmService, this::updateChannels, List.of(CHANNEL_ALARM_STATE)); this.registerStatelessService(armActionService); this.registerStatelessService(disarmActionService); @@ -110,6 +110,7 @@ public class IntrusionDetectionHandler extends BoschSHCHandler { private void updateChannels(IntrusionDetectionControlState controlState) { super.updateState(CHANNEL_ARMING_STATE, new StringType(controlState.value.toString())); + super.updateState(CHANNEL_ACTIVE_CONFIGURATION_PROFILE, new StringType(controlState.activeProfile)); } private void updateChannels(SurveillanceAlarmState surveillanceAlarmState) { diff --git a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/intrusion/IntrusionDetectionHandlerTest.java b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/intrusion/IntrusionDetectionHandlerTest.java index 5f69b925e..1e318efc7 100644 --- a/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/intrusion/IntrusionDetectionHandlerTest.java +++ b/bundles/org.openhab.binding.boschshc/src/test/java/org/openhab/binding/boschshc/internal/devices/intrusion/IntrusionDetectionHandlerTest.java @@ -161,6 +161,9 @@ class IntrusionDetectionHandlerTest extends AbstractBoschSHCHandlerTest