Set code_arm_required to False for homekit_controller (#133284)

pull/133304/head
J. Nick Koston 2024-12-15 12:28:29 -06:00 committed by GitHub
parent 6d6445bfcf
commit e81add5a06
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 2 deletions

View File

@ -69,6 +69,7 @@ class HomeKitAlarmControlPanelEntity(HomeKitEntity, AlarmControlPanelEntity):
| AlarmControlPanelEntityFeature.ARM_AWAY
| AlarmControlPanelEntityFeature.ARM_NIGHT
)
_attr_code_arm_required = False
def get_characteristic_types(self) -> list[str]:
"""Define the homekit characteristics the entity cares about."""

View File

@ -1474,7 +1474,7 @@
'state': dict({
'attributes': dict({
'changed_by': None,
'code_arm_required': True,
'code_arm_required': False,
'code_format': None,
'friendly_name': 'Aqara-Hub-E1-00A0 Security System',
'supported_features': <AlarmControlPanelEntityFeature: 7>,
@ -1848,7 +1848,7 @@
'state': dict({
'attributes': dict({
'changed_by': None,
'code_arm_required': True,
'code_arm_required': False,
'code_format': None,
'friendly_name': 'Aqara Hub-1563 Security System',
'supported_features': <AlarmControlPanelEntityFeature: 7>,

View File

@ -6,6 +6,7 @@ from aiohomekit.model import Accessory
from aiohomekit.model.characteristics import CharacteristicsTypes
from aiohomekit.model.services import ServicesTypes
from homeassistant.components.alarm_control_panel import ATTR_CODE_ARM_REQUIRED
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
@ -106,6 +107,7 @@ async def test_switch_read_alarm_state(
state = await helper.poll_and_get_state()
assert state.state == "armed_home"
assert state.attributes["battery_level"] == 50
assert state.attributes[ATTR_CODE_ARM_REQUIRED] is False
await helper.async_update(
ServicesTypes.SECURITY_SYSTEM,