1 """Support for Velbus covers."""
3 from __future__
import annotations
7 from velbusaio.channels
import Blind
as VelbusBlind
18 from .const
import DOMAIN
19 from .entity
import VelbusEntity, api_call
25 async_add_entities: AddEntitiesCallback,
27 """Set up Velbus switch based on config_entry."""
28 await hass.data[DOMAIN][entry.entry_id][
"tsk"]
29 cntrl = hass.data[DOMAIN][entry.entry_id][
"cntrl"]
34 """Representation a Velbus cover."""
39 def __init__(self, channel: VelbusBlind) ->
None:
40 """Initialize the cover."""
42 if self.
_channel_channel.support_position():
44 CoverEntityFeature.OPEN
45 | CoverEntityFeature.CLOSE
46 | CoverEntityFeature.STOP
47 | CoverEntityFeature.SET_POSITION
51 CoverEntityFeature.OPEN
52 | CoverEntityFeature.CLOSE
53 | CoverEntityFeature.STOP
61 """Return if the cover is closed."""
62 if self.
_channel_channel.support_position():
68 """Return if the cover is opening."""
75 """Return if the cover is closing."""
82 """Return current position of cover.
84 None is unknown, 0 is closed, 100 is fully open
85 Velbus: 100 = closed, 0 = open
87 pos = self.
_channel_channel.get_position()
99 """Close the cover."""
104 """Stop the cover."""
109 """Move the cover to a specific position."""
110 await self.
_channel_channel.set_position(100 - kwargs[ATTR_POSITION])
None __init__(self, VelbusBlind channel)
None async_set_cover_position(self, **Any kwargs)
None async_stop_cover(self, **Any kwargs)
None async_close_cover(self, **Any kwargs)
None async_open_cover(self, **Any kwargs)
bool|None is_closed(self)
None open(self, **Any kwargs)
None async_setup_entry(HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)