diff --git a/homeassistant/components/deconz/lock.py b/homeassistant/components/deconz/lock.py index 78ccae30441..cf4bd7f14f5 100644 --- a/homeassistant/components/deconz/lock.py +++ b/homeassistant/components/deconz/lock.py @@ -62,8 +62,26 @@ class DeconzLock(DeconzDevice, LockEntity): async def async_lock(self, **kwargs: Any) -> None: """Lock the lock.""" - await self._device.lock() + if isinstance(self._device, DoorLock): + await self.gateway.api.sensors.door_lock.set_config( + id=self._device.resource_id, + lock=True, + ) + else: + await self.gateway.api.lights.locks.set_state( + id=self._device.resource_id, + lock=True, + ) async def async_unlock(self, **kwargs: Any) -> None: """Unlock the lock.""" - await self._device.unlock() + if isinstance(self._device, DoorLock): + await self.gateway.api.sensors.door_lock.set_config( + id=self._device.resource_id, + lock=False, + ) + else: + await self.gateway.api.lights.locks.set_state( + id=self._device.resource_id, + lock=False, + ) diff --git a/homeassistant/components/deconz/scene.py b/homeassistant/components/deconz/scene.py index dfbb6ae828b..236389cc100 100644 --- a/homeassistant/components/deconz/scene.py +++ b/homeassistant/components/deconz/scene.py @@ -43,4 +43,7 @@ class DeconzScene(DeconzSceneMixin, Scene): async def async_activate(self, **kwargs: Any) -> None: """Activate the scene.""" - await self._device.recall() + await self.gateway.api.scenes.recall( + self._device.group_id, + self._device.id, + ) diff --git a/homeassistant/components/deconz/siren.py b/homeassistant/components/deconz/siren.py index 8427b6ce75d..d44bce01aad 100644 --- a/homeassistant/components/deconz/siren.py +++ b/homeassistant/components/deconz/siren.py @@ -59,11 +59,17 @@ class DeconzSiren(DeconzDevice, SirenEntity): async def async_turn_on(self, **kwargs: Any) -> None: """Turn on siren.""" - data = {} if (duration := kwargs.get(ATTR_DURATION)) is not None: - data["duration"] = duration * 10 - await self._device.turn_on(**data) + duration *= 10 + await self.gateway.api.lights.sirens.set_state( + id=self._device.resource_id, + on=True, + duration=duration, + ) async def async_turn_off(self, **kwargs: Any) -> None: """Turn off siren.""" - await self._device.turn_off() + await self.gateway.api.lights.sirens.set_state( + id=self._device.resource_id, + on=False, + ) diff --git a/homeassistant/components/deconz/switch.py b/homeassistant/components/deconz/switch.py index d54ff1f36ba..b21ec929909 100644 --- a/homeassistant/components/deconz/switch.py +++ b/homeassistant/components/deconz/switch.py @@ -56,8 +56,14 @@ class DeconzPowerPlug(DeconzDevice, SwitchEntity): async def async_turn_on(self, **kwargs: Any) -> None: """Turn on switch.""" - await self._device.set_state(on=True) + await self.gateway.api.lights.lights.set_state( + id=self._device.resource_id, + on=True, + ) async def async_turn_off(self, **kwargs: Any) -> None: """Turn off switch.""" - await self._device.set_state(on=False) + await self.gateway.api.lights.lights.set_state( + id=self._device.resource_id, + on=False, + )