Closed daymondm closed 5 years ago
Lights and dimmers! Awesome 😍
@timcharper can you look over these changes by @daymondm?
Was able to get a camera feed in HomeKit today so... coming soon
all looks good.. just the issue with the dimmers that for some reason gets a random value when turning them off....i believe the dimmers only take a val: from 0-100 and not an s:. thats what i saw when capturing the events in postman.
i got this error.
setTimeout function should look like:
setTimeout(() => {
this.service.getCharacteristic(Characteristic.MotionDetected).updateValue(0)
this.data.vdt = 0
},5000
confirmed that this works.. ill update the code
@daymondm did you mean to close this?
Hi @timcharper, I fixed the notes that you had commented on. Thank you for the feedback!
Changes:
Changed the way security updates are handled, extracted into a separate function as advised, and ensured that messages are compared against last snapshot time
Removed all occurrences of numbers being hardcoded and created constants for readability
Added support for binary light switches and dimmer switches. Code will read the description of the device and create a fan, light, or switch control. Dimmer switches are assumed to be light switches.
Fixed a mistake with the garage door opener. Code was incorrectly setting target state to opposite of what it should've been. Easier to find that error now that the constants are used instead of hard coded numbers
Moved hard coded < 10% battery level as low to the configuration file.
Added some error checking with the battery service. Should allow the code to be used without deleting all the cached accessories and starting over, but if you choose that route you will not see battery service in HomeKit.
removed extra unnecessary files