1 """Support for Insteon lights via PowerLinc Modem."""
5 from pyinsteon.config
import ON_LEVEL
6 from pyinsteon.device_types.device_base
import Device
as InsteonDevice
15 from .const
import SIGNAL_ADD_ENTITIES
16 from .entity
import InsteonEntity
17 from .utils
import async_add_insteon_devices, async_add_insteon_entities
24 config_entry: ConfigEntry,
25 async_add_entities: AddEntitiesCallback,
27 """Set up the Insteon lights from a config entry."""
30 def async_add_insteon_light_entities(discovery_info=None):
31 """Add the Insteon entities for the platform."""
40 signal = f
"{SIGNAL_ADD_ENTITIES}_{Platform.LIGHT}"
51 """A Class for an Insteon light entity."""
53 _attr_color_mode = ColorMode.BRIGHTNESS
54 _attr_supported_color_modes = {ColorMode.BRIGHTNESS}
56 def __init__(self, device: InsteonDevice, group: int) ->
None:
57 """Init the InsteonDimmerEntity entity."""
58 super().
__init__(device=device, group=group)
65 """Return the brightness of this light between 0..255."""
70 """Return the boolean response if the node is on."""
75 brightness: int |
None =
None
76 if ATTR_BRIGHTNESS
in kwargs:
77 brightness =
int(kwargs[ATTR_BRIGHTNESS])
def get_device_property(self, str name)
_attr_supported_color_modes
None async_turn_off(self, **Any kwargs)
dictionary _attr_supported_color_modes
None __init__(self, InsteonDevice device, int group)
None async_turn_on(self, **Any kwargs)
int|None brightness(self)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
None async_add_insteon_devices(HomeAssistant hass, Platform platform, type[InsteonEntity] entity_type, AddEntitiesCallback async_add_entities)
None async_add_insteon_entities(HomeAssistant hass, Platform platform, type[InsteonEntity] entity_type, AddEntitiesCallback async_add_entities, dict[str, Any] discovery_info)
Callable[[], None] async_dispatcher_connect(HomeAssistant hass, str signal, Callable[..., Any] target)