1 """Support for Lutron shades."""
3 from __future__
import annotations
5 from collections.abc
import Mapping
9 from pylutron
import Output
20 from .
import DOMAIN, LutronData
21 from .entity
import LutronDevice
23 _LOGGER = logging.getLogger(__name__)
28 config_entry: ConfigEntry,
29 async_add_entities: AddEntitiesCallback,
31 """Set up the Lutron cover platform.
33 Adds shades from the Main Repeater associated with the config_entry as
36 entry_data: LutronData = hass.data[DOMAIN][config_entry.entry_id]
40 for area_name, device
in entry_data.covers
47 """Representation of a Lutron shade."""
49 _attr_supported_features = (
50 CoverEntityFeature.OPEN
51 | CoverEntityFeature.CLOSE
52 | CoverEntityFeature.SET_POSITION
54 _lutron_device: Output
58 """Close the cover."""
66 """Move the shade to a specific position."""
67 if ATTR_POSITION
in kwargs:
68 position = kwargs[ATTR_POSITION]
72 """Request the state from the device."""
76 """Update the state attributes."""
80 _LOGGER.debug(
"Lutron ID: %d updated to %f", self.
_lutron_device_lutron_device.id, level)
84 """Return the state attributes."""
85 return {
"lutron_integration_id": self.
_lutron_device_lutron_device.id}
_attr_current_cover_position
None open_cover(self, **Any kwargs)
None _request_state(self)
Mapping[str, Any]|None extra_state_attributes(self)
None set_cover_position(self, **Any kwargs)
None close_cover(self, **Any kwargs)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)