1 """Support for Modbus lights."""
3 from __future__
import annotations
14 from .entity
import BaseSwitch
15 from .modbus
import ModbusHub
23 async_add_entities: AddEntitiesCallback,
24 discovery_info: DiscoveryInfoType |
None =
None,
26 """Read configuration and create Modbus lights."""
27 if discovery_info
is None:
31 for entry
in discovery_info[CONF_LIGHTS]:
32 hub: ModbusHub =
get_hub(hass, discovery_info[CONF_NAME])
38 """Class representing a Modbus light."""
40 _attr_color_mode = ColorMode.ONOFF
41 _attr_supported_color_modes = {ColorMode.ONOFF}
None async_turn(self, int command)
None async_turn_on(self, **Any kwargs)
None async_setup_platform(HomeAssistant hass, ConfigType config, AddEntitiesCallback async_add_entities, DiscoveryInfoType|None discovery_info=None)
ModbusHub get_hub(HomeAssistant hass, str name)