1 """Support for Overkiz locks."""
3 from __future__
import annotations
7 from pyoverkiz.enums
import OverkizCommand, OverkizCommandParam, OverkizState
15 from .
import HomeAssistantOverkizData
16 from .const
import DOMAIN
17 from .entity
import OverkizEntity
23 async_add_entities: AddEntitiesCallback,
25 """Set up the Overkiz locks from a config entry."""
26 data: HomeAssistantOverkizData = hass.data[DOMAIN][entry.entry_id]
30 for device
in data.platforms[Platform.LOCK]
35 """Representation of an Overkiz Lock."""
39 await self.
executorexecutor.async_execute_command(OverkizCommand.LOCK)
43 await self.
executorexecutor.async_execute_command(OverkizCommand.UNLOCK)
47 """Return a boolean for the state of the lock."""
49 self.
executorexecutor.select_state(OverkizState.CORE_LOCKED_UNLOCKED)
50 == OverkizCommandParam.LOCKED
bool|None is_locked(self)
None async_unlock(self, **Any kwargs)
None async_lock(self, **Any kwargs)
None async_setup_entry(HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)