diff --git a/paradox/interfaces/mqtt/entities/alarm_control_panel.py b/paradox/interfaces/mqtt/entities/alarm_control_panel.py index a91aeff..4352057 100644 --- a/paradox/interfaces/mqtt/entities/alarm_control_panel.py +++ b/paradox/interfaces/mqtt/entities/alarm_control_panel.py @@ -26,6 +26,12 @@ def serialize(self): )) if self.code is not None: config['code']=self.code + else: + config.update(dict( + code_arm_required=False, + code_disarm_required=False, + code_trigger_required=False + )) return config @property diff --git a/tests/interfaces/mqtt/test_entities.py b/tests/interfaces/mqtt/test_entities.py index f43c90c..edc61b1 100644 --- a/tests/interfaces/mqtt/test_entities.py +++ b/tests/interfaces/mqtt/test_entities.py @@ -25,6 +25,9 @@ def test_alarm_control_panel_serialize(mqtt_entity_factory): 'payload_arm_home': 'arm_stay', 'payload_arm_night': 'arm_sleep', 'payload_disarm': 'disarm', + 'code_arm_required': False, + 'code_disarm_required': False, + 'code_trigger_required': False } assert alarm_control_panel.configuration_topic == "homeassistant/alarm_control_panel/1234abcd/partition_partition_1/config" diff --git a/tests/interfaces/mqtt/test_homeassistant.py b/tests/interfaces/mqtt/test_homeassistant.py index 97515b5..a47562a 100644 --- a/tests/interfaces/mqtt/test_homeassistant.py +++ b/tests/interfaces/mqtt/test_homeassistant.py @@ -88,7 +88,10 @@ async def test_hass(mocker): "payload_disarm": "disarm", "payload_arm_home": "arm_stay", "payload_arm_away": "arm", - "payload_arm_night": "arm_sleep" + "payload_arm_night": "arm_sleep", + 'code_arm_required': False, + 'code_disarm_required': False, + 'code_trigger_required': False }, 0, True