Skip to content

Commit

Permalink
fix: Set default value for None kvj#181
Browse files Browse the repository at this point in the history
  • Loading branch information
inc-ali committed Jan 18, 2024
1 parent efd4de0 commit 62a92fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/nuki_ng/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 62a92fe

Please sign in to comment.