Fix issue with nuki new available state (#25881)

This commit is contained in:
Pascal Vizeli authored and Paulus Schoutsen committed 2019-08-11 20:48:56 -07:00
1 parent 87119472a3
commit af70b6da20
1 file changed
+6 -4
+6 -4
View File
@@ -144,10 +144,12 @@ class NukiLock(LockDevice):
self._nuki_lock.update(aggressive=False)
except requests.exceptions.RequestException:
self._available = False
else:
self._name = self._nuki_lock.name
self._locked = self._nuki_lock.is_locked
self._battery_critical = self._nuki_lock.battery_critical
return
self._available = self._nuki_lock.state != 255
self._name = self._nuki_lock.name
self._locked = self._nuki_lock.is_locked
self._battery_critical = self._nuki_lock.battery_critical
def lock(self, **kwargs):
"""Lock the device."""