homebridge-plugins / homebridge-august

The Homebridge August plugin allows you to access your August/Yale Locks from HomeKit with Homebridge.
ISC License
36 stars 9 forks source link

ParseInt validateCode #30

Closed evantobin closed 1 year ago

evantobin commented 1 year ago

Parse validateCode as an integer. We could make the UI take in an integer, but then the user is presented with a number selector which isn't ideal. Easiest to keep it as a string in the UI and just parse it as an int on the backend.

:recycle: Current situation

The Homebridge UI puts the verification code in the config as a string which causes an authentication error on august's servers. Changing it to an int works, but then you have to manually update the config.

:bulb: Proposed solution

Add parseInt before the code is sent to the server. This way both integer and string verification codes will work right with august's servers.

:gear: Release Notes

Plugin now works correctly with string-based verification code configs.

Testing

N/A

donavanbecker commented 1 year ago

Thanks!

donavanbecker commented 1 year ago

@evantobin, if you have any other enhancements you think would help the plugin. Feel free to let me know.