Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove incorrect logging about Unknown device #135585

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions homeassistant/components/vesync/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,12 @@ def _setup_entities(
async_add_entities,
coordinator: VeSyncDataCoordinator,
):
"""Check if device is online and add entity."""
entities = []
for dev in devices:
if DEV_TYPE_TO_HA.get(SKU_TO_BASE_DEVICE.get(dev.device_type, "")) == "fan":
entities.append(VeSyncFanHA(dev, coordinator))
else:
_LOGGER.warning(
"%s - Unknown device type - %s", dev.device_name, dev.device_type
)
continue
"""Check if device is fan and add entity."""
entities = [
VeSyncFanHA(dev, coordinator)
for dev in devices
if DEV_TYPE_TO_HA.get(SKU_TO_BASE_DEVICE.get(dev.device_type, "")) == "fan"
]

async_add_entities(entities, update_before_add=True)

Expand Down
7 changes: 1 addition & 6 deletions homeassistant/components/vesync/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,13 @@ def _setup_entities(
async_add_entities,
coordinator: VeSyncDataCoordinator,
):
"""Check if device is online and add entity."""
"""Check if device is a light and add entity."""
entities: list[VeSyncBaseLightHA] = []
for dev in devices:
if DEV_TYPE_TO_HA.get(dev.device_type) in ("walldimmer", "bulb-dimmable"):
entities.append(VeSyncDimmableLightHA(dev, coordinator))
elif DEV_TYPE_TO_HA.get(dev.device_type) in ("bulb-tunable-white",):
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)

Expand Down
7 changes: 1 addition & 6 deletions homeassistant/components/vesync/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,13 @@ def _setup_entities(
async_add_entities,
coordinator: VeSyncDataCoordinator,
):
"""Check if device is online and add entity."""
"""Check if device is a switch and add entity."""
entities: list[VeSyncBaseSwitch] = []
for dev in devices:
if DEV_TYPE_TO_HA.get(dev.device_type) == "outlet":
entities.append(VeSyncSwitchHA(dev, coordinator))
elif DEV_TYPE_TO_HA.get(dev.device_type) == "switch":
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)

Expand Down