Homekit Bugfix: Use get instead of indexing (#13353)
Fixes bug for alarm_control_panel if not code is required.
This commit is contained in:
1 parent
74c249e57d
commit
0396725fe9
1 file changed
+2
-1
@@ -107,7 +107,8 @@ def get_accessory(hass, state, aid, config):
|
||||
_LOGGER.debug('Add "%s" as "%s"', state.entity_id,
|
||||
'SecuritySystem')
|
||||
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':
|
||||
features = state.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
|
||||
|
||||
Reference in new issue
Block a user