[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 <dev@davidpace.de>
This commit is contained in:
parent
62f9f03bbf
commit
ff873fff14
|
@ -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) {
|
||||
|
|
|
@ -161,6 +161,9 @@ class IntrusionDetectionHandlerTest extends AbstractBoschSHCHandlerTest<Intrusio
|
|||
verify(getCallback()).stateUpdated(
|
||||
new ChannelUID(getThing().getUID(), BoschSHCBindingConstants.CHANNEL_ARMING_STATE),
|
||||
new StringType("SYSTEM_ARMING"));
|
||||
verify(getCallback()).stateUpdated(
|
||||
new ChannelUID(getThing().getUID(), BoschSHCBindingConstants.CHANNEL_ACTIVE_CONFIGURATION_PROFILE),
|
||||
new StringType("0"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue