Homekit Bugfix: Use get instead of indexing (#13353)

Fixes bug for alarm_control_panel if not code is required.
pull/13385/head
maxclaey 2018-03-21 19:06:46 +01:00 committed by cdce8p
parent 74c249e57d
commit 0396725fe9
1 changed files with 2 additions and 1 deletions

View File

@ -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)