mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Allow qwikswitch sensors as part of devices (#14454)
This commit is contained in:
parent
8ae3caa292
commit
6b9c65c9ce
@ -150,8 +150,10 @@ async def async_setup(hass, config):
|
|||||||
comps = {'switch': [], 'light': [], 'sensor': [], 'binary_sensor': []}
|
comps = {'switch': [], 'light': [], 'sensor': [], 'binary_sensor': []}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
sensor_ids = []
|
||||||
for sens in sensors:
|
for sens in sensors:
|
||||||
_, _type = SENSORS[sens['type']]
|
_, _type = SENSORS[sens['type']]
|
||||||
|
sensor_ids.append(sens['id'])
|
||||||
if _type is bool:
|
if _type is bool:
|
||||||
comps['binary_sensor'].append(sens)
|
comps['binary_sensor'].append(sens)
|
||||||
continue
|
continue
|
||||||
@ -192,9 +194,7 @@ async def async_setup(hass, config):
|
|||||||
'qwikswitch.button.{}'.format(qspacket[QS_ID]), qspacket)
|
'qwikswitch.button.{}'.format(qspacket[QS_ID]), qspacket)
|
||||||
return
|
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)
|
_LOGGER.debug("Dispatch %s ((%s))", qspacket[QS_ID], qspacket)
|
||||||
hass.helpers.dispatcher.async_dispatcher_send(
|
hass.helpers.dispatcher.async_dispatcher_send(
|
||||||
qspacket[QS_ID], qspacket)
|
qspacket[QS_ID], qspacket)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user