From 1536dd5c1a8bf590e585d6f3eeb0790971e28c62 Mon Sep 17 00:00:00 2001 From: SukramJ Date: Fri, 26 Jul 2024 14:52:48 +0200 Subject: [PATCH] Fix LockEntityFeature for button lock (#688) --- custom_components/homematicip_local/lock.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/custom_components/homematicip_local/lock.py b/custom_components/homematicip_local/lock.py index 6b003b17..0c84b9e5 100644 --- a/custom_components/homematicip_local/lock.py +++ b/custom_components/homematicip_local/lock.py @@ -57,7 +57,15 @@ def async_add_lock(hm_entities: tuple[BaseLock, ...]) -> None: class HaHomematicLock(HaHomematicGenericRestoreEntity[BaseLock], LockEntity): """Representation of the HomematicIP lock entity.""" - _attr_supported_features = LockEntityFeature.OPEN + def __init__( + self, + control_unit: ControlUnit, + hm_entity: BaseLock, + ) -> None: + """Initialize the lock entity.""" + super().__init__(control_unit=control_unit, hm_entity=hm_entity) + if hm_entity.supports_open: + self._attr_supported_features = LockEntityFeature.OPEN @property def is_locked(self) -> bool | None: