Closed lockpicker closed 3 years ago
Also, the 30 second wait I've introduced post fetching the new version number is for avoiding repeated calls and log flooding if there's an issue with the api and given the version number changes are rather infrequent, the 30 seconds once off wait shouldn't make a big difference.
@codyc1515 Bump for you to have a look
Case in point. This December there was a small breaking API change on the Panasonic side. This required a manual fix still.
Have a look and see if this makes sense to include.
Main change: The version header that the API expects, expects the version of the Panasonic Comfort cloud app so we can auto fetch the version of the app from the App Store api, if we see that the version has changed. This is also referenced in the API response which suggests that there's a new app version published. This will allow the plugin to continue operating without breaking and the hardcoded version in code can be updated in the background and consumed whenever the plugin is re-installed. P.S: I've used the got library for async / await to avoid callback hell and also as request is now deprecated and starting to be used less.
Small additional changes: