1 """Support for Gogogate2 garage Doors."""
3 from __future__
import annotations
7 from ismartgate.common
import (
23 from .common
import cover_unique_id, get_data_update_coordinator
24 from .coordinator
import DeviceDataUpdateCoordinator
25 from .entity
import GoGoGate2Entity
30 config_entry: ConfigEntry,
31 async_add_entities: AddEntitiesCallback,
33 """Set up the config entry."""
38 DeviceCover(config_entry, data_update_coordinator, door)
39 for door
in get_configured_doors(data_update_coordinator.data)
45 """Cover entity for gogogate2."""
47 _attr_supported_features = CoverEntityFeature.OPEN | CoverEntityFeature.CLOSE
51 config_entry: ConfigEntry,
52 data_update_coordinator: DeviceDataUpdateCoordinator,
55 """Initialize the object."""
57 super().
__init__(config_entry, data_update_coordinator, door, unique_id)
59 CoverDeviceClass.GATE
if self.
doordoor.gate
else CoverDeviceClass.GARAGE
63 def name(self) -> str | None:
64 """Return the name of the door."""
65 return self.
doordoor.name
69 """Return true if cover is closed, else False."""
71 if door_status == DoorStatus.OPENED:
73 if door_status == DoorStatus.CLOSED:
79 """Return if the cover is closing or not."""
84 """Return if the cover is opening or not."""
89 await self.
_api_api.async_open_door(self.
_door_id_door_id)
94 await self.
_api_api.async_close_door(self.
_door_id_door_id)
bool|None is_closed(self)
None async_close_cover(self, **Any kwargs)
None async_open_cover(self, **Any kwargs)
None __init__(self, ConfigEntry config_entry, DeviceDataUpdateCoordinator data_update_coordinator, AbstractDoor door)
AbstractDoor door_status(self)
DeviceDataUpdateCoordinator get_data_update_coordinator(HomeAssistant hass, ConfigEntry config_entry)
str cover_unique_id(ConfigEntry config_entry, AbstractDoor door)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)