From 052fe46daf115f6b46a98dcf3ee49332b0811aae Mon Sep 17 00:00:00 2001 From: Alisan Stoll <23653980+inc-ali@users.noreply.github.com> Date: Wed, 3 Jan 2024 17:04:03 +0100 Subject: [PATCH] Gracefully mapping value to lock_state (#168) --- custom_components/nuki_ng/sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/nuki_ng/sensor.py b/custom_components/nuki_ng/sensor.py index 9052a7c..d4d8290 100644 --- a/custom_components/nuki_ng/sensor.py +++ b/custom_components/nuki_ng/sensor.py @@ -141,7 +141,7 @@ def state(self): return str(self.get_state()) def get_state(self) -> DoorSecurityStates: - lock_state = LockStates(self.last_state.get("state")) + lock_state = LockStates(self.last_state.get("state", LockStates.UNDEFINED.value)) door_sensor_state = DoorSensorStates( self.last_state.get("doorsensorState"))