-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Fix TOD incorrectly determining the state between sunrise and sunset #65884
Conversation
…nd sunset (home-assistant#30199) * TOD fix * Comment added * Review * Review * Review
Looks like I'll need to update the previous patch a little. Was hoping it'd be a simple cherry-pick only. |
Seems to run fine now with the trivial edit on the original cherry-picked commit and confirmed locally the issue is resolved. Is it fine to be merged as-is, otherwise I can squash the two commits into one if that's preferred. |
Strangely running black locally didn't complain, but the CI workflow didn't like it. Guessing I'm not running black with the right config locally? https://developers.home-assistant.io/blog/2019/07/31/black/ didn't indicate much |
Finally sorted out my environment, turns out I was on the wrong branch running black and unit tests hence thinking it was working. I've also added a unit test now that fails without this fix, but succeeds with the fix enabled. I squashed all of my commits into a single commit, but I left the original cherry-picked commit to retain author information. |
current version. Only apply fix when using times and not when using sun events. Add unit test for behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
…65884) * Fix TOD component incorrectly determining the state between sunrise and sunset (#30199) * TOD fix * Comment added * Review * Review * Review * Update time after day fix workaround for compatibility with current version. Only apply fix when using times and not when using sun events. Add unit test for behaviour. Co-authored-by: Nikolay Vasilchuk <Anonym.tsk@gmail.com>
Proposed change
The changes made in PR #30199 which contains fixes for #24577 and #21974 were accidentally reverted in #48573 which has caused the time of day component to show an incorrect state after home assistant restarts in some situations, for example as per #50315
This PR is just a cherry-pick of the commit from #30199 to re-apply the same fix.
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: