From 6b9c65c9ce8523b7f28a4f7b0758c945a75d8668 Mon Sep 17 00:00:00 2001 From: Johann Kellerman Date: Mon, 14 May 2018 08:40:25 +0200 Subject: [PATCH] Allow qwikswitch sensors as part of devices (#14454) --- homeassistant/components/qwikswitch.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/qwikswitch.py b/homeassistant/components/qwikswitch.py index f26318fa7a9..63e30a9491e 100644 --- a/homeassistant/components/qwikswitch.py +++ b/homeassistant/components/qwikswitch.py @@ -150,8 +150,10 @@ async def async_setup(hass, config): comps = {'switch': [], 'light': [], 'sensor': [], 'binary_sensor': []} try: + sensor_ids = [] for sens in sensors: _, _type = SENSORS[sens['type']] + sensor_ids.append(sens['id']) if _type is bool: comps['binary_sensor'].append(sens) continue @@ -192,9 +194,7 @@ async def async_setup(hass, config): 'qwikswitch.button.{}'.format(qspacket[QS_ID]), qspacket) return - if qspacket[QS_ID] not in qsusb.devices: - # Not a standard device in, component can handle packet - # i.e. sensors + if qspacket[QS_ID] in sensor_ids: _LOGGER.debug("Dispatch %s ((%s))", qspacket[QS_ID], qspacket) hass.helpers.dispatcher.async_dispatcher_send( qspacket[QS_ID], qspacket)