From 5a25b4883d3c6e7f513fb7484d1c0f6c94c23b46 Mon Sep 17 00:00:00 2001 From: Johann Kellerman Date: Sun, 13 May 2018 20:32:00 +0200 Subject: [PATCH 1/2] sensor_ids --- homeassistant/components/qwikswitch.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/qwikswitch.py b/homeassistant/components/qwikswitch.py index f26318fa7a926..def1da8515bb2 100644 --- a/homeassistant/components/qwikswitch.py +++ b/homeassistant/components/qwikswitch.py @@ -150,8 +150,10 @@ def callback_value_changed(_qsd, qsid, _val): 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,7 +194,7 @@ def callback_qs_listen(qspacket): 'qwikswitch.button.{}'.format(qspacket[QS_ID]), qspacket) return - if qspacket[QS_ID] not in qsusb.devices: + if qspacket[QS_ID] in sensor_ids: # Not a standard device in, component can handle packet # i.e. sensors _LOGGER.debug("Dispatch %s ((%s))", qspacket[QS_ID], qspacket) From 13e2e981df406d95daa0cb2d08cd5b4bcc016071 Mon Sep 17 00:00:00 2001 From: Johann Kellerman Date: Sun, 13 May 2018 20:35:23 +0200 Subject: [PATCH 2/2] comment --- homeassistant/components/qwikswitch.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/homeassistant/components/qwikswitch.py b/homeassistant/components/qwikswitch.py index def1da8515bb2..63e30a9491ede 100644 --- a/homeassistant/components/qwikswitch.py +++ b/homeassistant/components/qwikswitch.py @@ -195,8 +195,6 @@ def callback_qs_listen(qspacket): return if qspacket[QS_ID] in sensor_ids: - # Not a standard device in, component can handle packet - # i.e. sensors _LOGGER.debug("Dispatch %s ((%s))", qspacket[QS_ID], qspacket) hass.helpers.dispatcher.async_dispatcher_send( qspacket[QS_ID], qspacket)