1
0
mirror of https://github.com/home-assistant/core.git synced 2026-06-05 07:04:05 +01:00
Files
core/homeassistant/components/vesync/common.py
T
2025-01-10 12:30:29 +01:00

27 lines
643 B
Python

"""Common utilities for VeSync Component."""
import logging
from pyvesync import VeSync
from pyvesync.vesyncbasedevice import VeSyncBaseDevice
from homeassistant.core import HomeAssistant
_LOGGER = logging.getLogger(__name__)
async def async_generate_device_list(
hass: HomeAssistant, manager: VeSync
) -> list[VeSyncBaseDevice]:
"""Assign devices to proper component."""
devices: list[VeSyncBaseDevice] = []
await hass.async_add_executor_job(manager.update)
devices.extend(manager.fans)
devices.extend(manager.bulbs)
devices.extend(manager.outlets)
devices.extend(manager.switches)
return devices