Consider Continuous Mode on Nuki Opener to be "unlocked" (#49557)

Co-authored-by: Franck Nijhof <git@frenck.dev>
pull/51088/head
Anaïs Betts 2021-05-25 21:05:56 +02:00 committed by GitHub
parent 8b21a652ba
commit d82f6abbe4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -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."""