1 """Support for Insteon covers via PowerLinc Modem."""
17 from .const
import SIGNAL_ADD_ENTITIES
18 from .entity
import InsteonEntity
19 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 covers from a config entry."""
30 def async_add_insteon_cover_entities(discovery_info=None):
31 """Add the Insteon entities for the platform."""
33 hass, Platform.COVER, InsteonCoverEntity, async_add_entities, discovery_info
36 signal = f
"{SIGNAL_ADD_ENTITIES}_{Platform.COVER}"
47 """A Class for an Insteon cover entity."""
49 _attr_supported_features = (
50 CoverEntityFeature.OPEN
51 | CoverEntityFeature.CLOSE
52 | CoverEntityFeature.SET_POSITION
57 """Return the current cover position."""
62 return int(math.ceil(pos * 100 / 255))
66 """Return the boolean response if the node is on."""
78 """Set the cover position."""
79 position =
int(kwargs[ATTR_POSITION] * 255 / 100)
int|None current_cover_position(self)
None async_open_cover(self, **Any kwargs)
None async_set_cover_position(self, **Any kwargs)
int current_cover_position(self)
None async_close_cover(self, **Any kwargs)
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)