1 """Demo platform that has a couple of fake locks."""
3 from __future__
import annotations
17 async_add_entities: AddEntitiesCallback,
18 discovery_info: DiscoveryInfoType |
None =
None,
20 """Set up the Demo locks."""
24 "kitchen_sink_lock_001",
27 LockEntityFeature.OPEN,
30 "kitchen_sink_lock_002",
31 "Another openable lock",
33 LockEntityFeature.OPEN,
36 "kitchen_sink_lock_003",
41 "kitchen_sink_lock_004",
51 config_entry: ConfigEntry,
52 async_add_entities: AddEntitiesCallback,
54 """Set up the Everything but the Kitchen Sink config entry."""
59 """Representation of a Demo lock."""
68 """Initialize the sensor."""
78 """Return true if lock is locked."""
79 return self.
_state_state == LockState.LOCKED
83 """Return true if lock is open."""
84 return self.
_state_state == LockState.OPEN
87 """Lock the device."""
91 self.
_state_state = LockState.LOCKED
95 """Unlock the device."""
99 self.
_state_state = LockState.UNLOCKED
103 """Open the door latch."""
104 self.
_state_state = LockState.OPEN
None async_lock(self, **Any kwargs)
None async_open(self, **Any kwargs)
None async_unlock(self, **Any kwargs)
None __init__(self, str unique_id, str name, str state, LockEntityFeature features=LockEntityFeature(0))
None async_write_ha_state(self)
None async_setup_platform(HomeAssistant hass, ConfigType config, AddEntitiesCallback async_add_entities, DiscoveryInfoType|None discovery_info=None)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)