From d82f6abbe44c01049e8a341709ebf6bd47bc2012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ana=C3=AFs=20Betts?= Date: Tue, 25 May 2021 21:05:56 +0200 Subject: [PATCH] Consider Continuous Mode on Nuki Opener to be "unlocked" (#49557) Co-authored-by: Franck Nijhof --- homeassistant/components/nuki/lock.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/nuki/lock.py b/homeassistant/components/nuki/lock.py index ca6e72bde8f..48e72b88530 100644 --- a/homeassistant/components/nuki/lock.py +++ b/homeassistant/components/nuki/lock.py @@ -2,6 +2,7 @@ from abc import ABC, abstractmethod import logging +from pynuki import MODE_OPENER_CONTINUOUS import voluptuous as vol from homeassistant.components.lock import PLATFORM_SCHEMA, SUPPORT_OPEN, LockEntity @@ -144,8 +145,11 @@ class NukiOpenerEntity(NukiDeviceEntity): @property def is_locked(self): - """Return true if ring-to-open is enabled.""" - return not self._nuki_device.is_rto_activated + """Return true if either ring-to-open or continuous mode is enabled.""" + return not ( + self._nuki_device.is_rto_activated + or self._nuki_device.mode == MODE_OPENER_CONTINUOUS + ) def lock(self, **kwargs): """Disable ring-to-open."""