miio
miio copied to clipboard
Magnet value fix
There is an issue with the lumi.magnet initial value fetching in combination with the homebridge-miio-gateway and miio library. It returns the first value properly, but then triggers a second event where the value == null. This causes the the state to change to Open, when the actual state is Closed.
Fix: filter out null and undefined values.
This works.