get_entity_histories() - fixed date formatting#202
get_entity_histories() - fixed date formatting#202GrandMoff100 merged 10 commits intoGrandMoff100:devfrom timohencken:fix/history_dates
Conversation
|
Thanks so much for catching that! I appreciate it. I will review it as soon as I have a moment |
|
Missing imports were added, ruff and mypy are happy now. |
|
'Twasn't an inconvenience at all :) |
|
Woohoo! Checks pass. I just request you run the changes and double check the tests are working and that you're satisfied with the changes. Let me know when you do that. Thank you so much for opening a PR! I hope you have a good weekend. |
|
Thank you so much for your effort to make this change possible. I just gave it a try in my setup and it works wonderfully. Looking forward to seeing this in the next release. Have a wonderful weekend! |
As noted in https://developers.home-assistant.io/docs/api/rest#actions -> "GET /api/history/period/", timestamps should have a second resolution (no microsecond) and should be timezone-aware.
Also, timetamp encoding has to be done manually, as get_entity_histories() utilizes construct_params() thus preventing request's default parameter encoding
Background:
I tried using timezone-aware datetime objects and ran into issue