-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception from set_curfew API (daylight saving change related?) #209
Comments
One thing I'm curious of is what the actual curfew will be - e.g. will the GET value change to |
Use my workaround for DST bug See benleb/surepy#209
The issue is no longer happening, I suspect that's because it's now after midnight UTC, so UTC date has changed.
For reference, I think the GET value was the one that would be used, I think the bug is that the PUT value was being incorrectly interpreted (i.e. I don't think the GET value would change), so to properly workaround this bug I'd need to adjust the time I'm setting. |
Not sure if it's connected but I have noticed that (at least for me here in the UK) whenever our local times change my curfew settings for our cat flap the next day show one hour out, and so every time the clocks change I have to remember to log into the Sure app, and fix the settings. I assume it's because they store them as UTC and then display them as local time, but then the flap enforces them as local time (which makes completely no sense). Just in case it is of use/interest. |
Possibly, though worth double checking you have your "Household" timezone to London time and not UTC. I don't know if the existing time changes for me at DST change, because I have an automated task updating the curfew times to match dawn/dusk every Sunday AM. FWIW there was a notification in the app "Clock change in your region? You may need to adjust curfew times" which suggests the backend implementation makes no sense like you suggested haha. |
Just a heads up in case others hit this - I've been getting an exception from the set_curfew API since daylight saving changed for me today (in NZ, so changing out of daylight saving).
I'll look at adding a workaround, but I think this is a once-a-year issue that will go away in a few hours. I think I had a similar issue this time last year.
I think this is because the Sure API is doing some weird adjustment (possibly a bug) to correct for daylight saving changing. Via the website, if I manually set the curfew end time it's subtracting one hour from the requested end time.
e.g. If via the Sure app, I set Unlock time of 7:39, then it succeeds, but shows time on the website (and via the API data) at 6:39.
PUT https://app-api.production.surehub.io/api/device/123/control
request:
200 response: (note unlock_time)
I think this is a timezone bug from the backend of the Sure app. Maybe something like it's using midnight of current date (rather than current date-time) to figure out if daylight saving is in effect.
On our side, the issue is that we fail this check, because the response unlock_time doesn't match the request time here:
surepy/surepy/client.py
Lines 375 to 380 in 9806785
Potentially we could change this to a warning.
The text was updated successfully, but these errors were encountered: