mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Homekit Bugfix: Use get instead of indexing (#13353)
Fixes bug for alarm_control_panel if not code is required.
This commit is contained in:
parent
74c249e57d
commit
0396725fe9
@ -107,7 +107,8 @@ def get_accessory(hass, state, aid, config):
|
|||||||
_LOGGER.debug('Add "%s" as "%s"', state.entity_id,
|
_LOGGER.debug('Add "%s" as "%s"', state.entity_id,
|
||||||
'SecuritySystem')
|
'SecuritySystem')
|
||||||
return TYPES['SecuritySystem'](hass, state.entity_id, state.name,
|
return TYPES['SecuritySystem'](hass, state.entity_id, state.name,
|
||||||
alarm_code=config[ATTR_CODE], aid=aid)
|
alarm_code=config.get(ATTR_CODE),
|
||||||
|
aid=aid)
|
||||||
|
|
||||||
elif state.domain == 'climate':
|
elif state.domain == 'climate':
|
||||||
features = state.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
|
features = state.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user