Consider Continuous Mode on Nuki Opener to be "unlocked" (#49557)
Co-authored-by: Franck Nijhof <git@frenck.dev>pull/51088/head
parent
8b21a652ba
commit
d82f6abbe4
|
@ -2,6 +2,7 @@
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
from pynuki import MODE_OPENER_CONTINUOUS
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components.lock import PLATFORM_SCHEMA, SUPPORT_OPEN, LockEntity
|
from homeassistant.components.lock import PLATFORM_SCHEMA, SUPPORT_OPEN, LockEntity
|
||||||
|
@ -144,8 +145,11 @@ class NukiOpenerEntity(NukiDeviceEntity):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_locked(self):
|
def is_locked(self):
|
||||||
"""Return true if ring-to-open is enabled."""
|
"""Return true if either ring-to-open or continuous mode is enabled."""
|
||||||
return not self._nuki_device.is_rto_activated
|
return not (
|
||||||
|
self._nuki_device.is_rto_activated
|
||||||
|
or self._nuki_device.mode == MODE_OPENER_CONTINUOUS
|
||||||
|
)
|
||||||
|
|
||||||
def lock(self, **kwargs):
|
def lock(self, **kwargs):
|
||||||
"""Disable ring-to-open."""
|
"""Disable ring-to-open."""
|
||||||
|
|
Loading…
Reference in New Issue