diff --git a/custom_components/nuki_ng/sensor.py b/custom_components/nuki_ng/sensor.py index 64c80ec..68ab0c7 100644 --- a/custom_components/nuki_ng/sensor.py +++ b/custom_components/nuki_ng/sensor.py @@ -145,7 +145,7 @@ def state(self): def get_state(self) -> DoorSecurityStates: lock_state = LockStates(self.last_state.get("state", LockStates.UNDEFINED.value)) door_sensor_state = DoorSensorStates( - self.last_state.get("doorsensorState"), DoorSensorStates.UNKNOWN.value) + self.last_state.get("doorsensorState", DoorSensorStates.UNKNOWN.value)) if lock_state == LockStates.LOCKED and door_sensor_state == DoorSensorStates.DOOR_CLOSED: return DoorSecurityStates.CLOSED_AND_LOCKED