mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Address late review of vesync light (#48130)
This commit is contained in:
parent
938a4cc1b6
commit
11596afdfc
@ -33,23 +33,22 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
|
||||
hass.data[DOMAIN][VS_DISPATCHERS].append(disp)
|
||||
|
||||
_async_setup_entities(hass.data[DOMAIN][VS_LIGHTS], async_add_entities)
|
||||
return True
|
||||
|
||||
|
||||
@callback
|
||||
def _async_setup_entities(devices, async_add_entities):
|
||||
"""Check if device is online and add entity."""
|
||||
dev_list = []
|
||||
entities = []
|
||||
for dev in devices:
|
||||
if DEV_TYPE_TO_HA.get(dev.device_type) == "light":
|
||||
dev_list.append(VeSyncDimmerHA(dev))
|
||||
entities.append(VeSyncDimmerHA(dev))
|
||||
else:
|
||||
_LOGGER.debug(
|
||||
"%s - Unknown device type - %s", dev.device_name, dev.device_type
|
||||
)
|
||||
continue
|
||||
|
||||
async_add_entities(dev_list, update_before_add=True)
|
||||
async_add_entities(entities, update_before_add=True)
|
||||
|
||||
|
||||
class VeSyncDimmerHA(VeSyncDevice, LightEntity):
|
||||
|
Loading…
x
Reference in New Issue
Block a user