kvj / hass_nuki_ng

Better support for Nuki devices in the Home Assistant
MIT License
185 stars 36 forks source link

Add DoorSensorState 0 to enum #62

Closed b3nn0 closed 2 years ago

b3nn0 commented 2 years ago

Hi, I have a Nuki Lock v3, but no other Nuki sensors. Apparently, it delivers a DoorSensorState of 0, resulting in an exception in this integration. It also makes the lock entity not work correctly (i.e. never updates).

Adding the DoorSensorState UNAVAILABLE = 0 to states.py solves all issues. Could this be added for the next version?

class DoorSensorStates(BaseStates):
    UNAVAILABLE = 0
    ...
alexdelprete commented 2 years ago

Strange, the bridge API doc doesn't mention 0 as a possible state:

image

b3nn0 commented 2 years ago

Yup.. got the idea from here: https://github.com/dauden1184/RaspiNukiBridge/issues/2 only seems to affect the Nuki V3 lock.

Works perfectly ever since adding that though.

EDIT: they have changed it to "UNAVAILABLE" later, so I just used that, too.

alexdelprete commented 2 years ago

They should update the docs...