1 """Support for AVM FRITZ!SmartHome cover devices."""
3 from __future__
import annotations
16 from .coordinator
import FritzboxConfigEntry
17 from .entity
import FritzBoxDeviceEntity
22 entry: FritzboxConfigEntry,
23 async_add_entities: AddEntitiesCallback,
25 """Set up the FRITZ!SmartHome cover from ConfigEntry."""
26 coordinator = entry.runtime_data
29 def _add_entities(devices: set[str] |
None =
None) ->
None:
32 devices = coordinator.new_devices
38 if coordinator.data.devices[ain].has_blind
41 entry.async_on_unload(coordinator.async_add_listener(_add_entities))
43 _add_entities(set(coordinator.data.devices))
47 """The cover class for FRITZ!SmartHome covers."""
49 _attr_device_class = CoverDeviceClass.BLIND
50 _attr_supported_features = (
51 CoverEntityFeature.OPEN
52 | CoverEntityFeature.SET_POSITION
53 | CoverEntityFeature.CLOSE
54 | CoverEntityFeature.STOP
59 """Return the current position."""
67 """Return if the cover is closed."""
78 """Close the cover."""
83 """Move the cover to a specific position."""
84 await self.
hasshasshass.async_add_executor_job(
None async_close_cover(self, **Any kwargs)
None async_open_cover(self, **Any kwargs)
None async_stop_cover(self, **Any kwargs)
bool|None is_closed(self)
None async_set_cover_position(self, **Any kwargs)
FritzhomeDevice data(self)
FritzhomeEntityBase data(self)
None async_setup_entry(HomeAssistant hass, FritzboxConfigEntry entry, AddEntitiesCallback async_add_entities)