Compatibility with API changes for app version 2.0.5.54
Closed this issue · 3 comments
Heads up, it looks like Sureflap changed their API sometime within the last week, to add support for multiple curfews in the current version of the app (2.0.5.54-9771d74), so there's now a list of curfews instead of a single lock/unlock time.
This has broken my integration ( https://github.com/therefromhere/sureflap_gcloud ), I think it's caused some issues with this library as well.
Incidentally, I was thinking about how we could detect or document these sorts of changes - one option would be adding asserts of the API return data structure, eg by using pydantic (though that would require Python >=3.6).
If you'd care to submit a pull request to fix the change in curfew format, that'd be great. I don't know when I'll get to it myself, otherwise.
Adding API change detection sounds like a good idea in principle, but also sounds like a fair bit of work. Sure don't change their API that often and I think this is the first time anything obvious in this API is broken.
Unfortunately, Sure expressed as unambiguous disinterest in supporting this API or providing any sort of API to end users on the grounds of infra load (even though I went to great lengths to mitigate and rate-limit such impact). They did not quite threaten me, but came close to. It's a pity, but also understandable.
Yep fair enough. I've made a start on defining a API parser/cache schema using pydantic here: therefromhere@a445ba2
Actually I don't think there's any changes needed for sure_petcare as a result of this, since the curfew times aren't touched directly.
Just in case anyone else hits a similar problem to me, the fix was just to make curfew a list of dicts instead of a single dict when setting it: