From b556b8630187caf7cc73a6c4d355003a1acda542 Mon Sep 17 00:00:00 2001 From: Bas Schipper Date: Wed, 28 Feb 2018 22:07:23 +0100 Subject: [PATCH] Fixed missing optional keyerror data_bits (#12789) --- homeassistant/components/binary_sensor/rfxtrx.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/binary_sensor/rfxtrx.py b/homeassistant/components/binary_sensor/rfxtrx.py index aedfc3364db..8c026131fd3 100644 --- a/homeassistant/components/binary_sensor/rfxtrx.py +++ b/homeassistant/components/binary_sensor/rfxtrx.py @@ -55,13 +55,13 @@ def setup_platform(hass, config, add_devices, discovery_info=None): if device_id in rfxtrx.RFX_DEVICES: continue - if entity[CONF_DATA_BITS] is not None: + if entity.get(CONF_DATA_BITS) is not None: _LOGGER.debug( "Masked device id: %s", rfxtrx.get_pt2262_deviceid( - device_id, entity[CONF_DATA_BITS])) + device_id, entity.get(CONF_DATA_BITS))) _LOGGER.debug("Add %s rfxtrx.binary_sensor (class %s)", - entity[ATTR_NAME], entity[CONF_DEVICE_CLASS]) + entity[ATTR_NAME], entity.get(CONF_DEVICE_CLASS)) device = RfxtrxBinarySensor( event, entity.get(CONF_NAME), entity.get(CONF_DEVICE_CLASS),