Remove incorrect logging about Unknown device (#135585)
parent
6e80ad505b
commit
6f138c71b4
|
@ -86,16 +86,12 @@ def _setup_entities(
|
||||||
async_add_entities,
|
async_add_entities,
|
||||||
coordinator: VeSyncDataCoordinator,
|
coordinator: VeSyncDataCoordinator,
|
||||||
):
|
):
|
||||||
"""Check if device is online and add entity."""
|
"""Check if device is fan and add entity."""
|
||||||
entities = []
|
entities = [
|
||||||
for dev in devices:
|
VeSyncFanHA(dev, coordinator)
|
||||||
if DEV_TYPE_TO_HA.get(SKU_TO_BASE_DEVICE.get(dev.device_type, "")) == "fan":
|
for dev in devices
|
||||||
entities.append(VeSyncFanHA(dev, coordinator))
|
if DEV_TYPE_TO_HA.get(SKU_TO_BASE_DEVICE.get(dev.device_type, "")) == "fan"
|
||||||
else:
|
]
|
||||||
_LOGGER.warning(
|
|
||||||
"%s - Unknown device type - %s", dev.device_name, dev.device_type
|
|
||||||
)
|
|
||||||
continue
|
|
||||||
|
|
||||||
async_add_entities(entities, update_before_add=True)
|
async_add_entities(entities, update_before_add=True)
|
||||||
|
|
||||||
|
|
|
@ -53,18 +53,13 @@ def _setup_entities(
|
||||||
async_add_entities,
|
async_add_entities,
|
||||||
coordinator: VeSyncDataCoordinator,
|
coordinator: VeSyncDataCoordinator,
|
||||||
):
|
):
|
||||||
"""Check if device is online and add entity."""
|
"""Check if device is a light and add entity."""
|
||||||
entities: list[VeSyncBaseLightHA] = []
|
entities: list[VeSyncBaseLightHA] = []
|
||||||
for dev in devices:
|
for dev in devices:
|
||||||
if DEV_TYPE_TO_HA.get(dev.device_type) in ("walldimmer", "bulb-dimmable"):
|
if DEV_TYPE_TO_HA.get(dev.device_type) in ("walldimmer", "bulb-dimmable"):
|
||||||
entities.append(VeSyncDimmableLightHA(dev, coordinator))
|
entities.append(VeSyncDimmableLightHA(dev, coordinator))
|
||||||
elif DEV_TYPE_TO_HA.get(dev.device_type) in ("bulb-tunable-white",):
|
elif DEV_TYPE_TO_HA.get(dev.device_type) in ("bulb-tunable-white",):
|
||||||
entities.append(VeSyncTunableWhiteLightHA(dev, coordinator))
|
entities.append(VeSyncTunableWhiteLightHA(dev, coordinator))
|
||||||
else:
|
|
||||||
_LOGGER.debug(
|
|
||||||
"%s - Unknown device type - %s", dev.device_name, dev.device_type
|
|
||||||
)
|
|
||||||
continue
|
|
||||||
|
|
||||||
async_add_entities(entities, update_before_add=True)
|
async_add_entities(entities, update_before_add=True)
|
||||||
|
|
||||||
|
|
|
@ -45,18 +45,13 @@ def _setup_entities(
|
||||||
async_add_entities,
|
async_add_entities,
|
||||||
coordinator: VeSyncDataCoordinator,
|
coordinator: VeSyncDataCoordinator,
|
||||||
):
|
):
|
||||||
"""Check if device is online and add entity."""
|
"""Check if device is a switch and add entity."""
|
||||||
entities: list[VeSyncBaseSwitch] = []
|
entities: list[VeSyncBaseSwitch] = []
|
||||||
for dev in devices:
|
for dev in devices:
|
||||||
if DEV_TYPE_TO_HA.get(dev.device_type) == "outlet":
|
if DEV_TYPE_TO_HA.get(dev.device_type) == "outlet":
|
||||||
entities.append(VeSyncSwitchHA(dev, coordinator))
|
entities.append(VeSyncSwitchHA(dev, coordinator))
|
||||||
elif DEV_TYPE_TO_HA.get(dev.device_type) == "switch":
|
elif DEV_TYPE_TO_HA.get(dev.device_type) == "switch":
|
||||||
entities.append(VeSyncLightSwitch(dev, coordinator))
|
entities.append(VeSyncLightSwitch(dev, coordinator))
|
||||||
else:
|
|
||||||
_LOGGER.warning(
|
|
||||||
"%s - Unknown device type - %s", dev.device_name, dev.device_type
|
|
||||||
)
|
|
||||||
continue
|
|
||||||
|
|
||||||
async_add_entities(entities, update_before_add=True)
|
async_add_entities(entities, update_before_add=True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue