-
-
Notifications
You must be signed in to change notification settings - Fork 28.4k
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
Make time trigger data trigger.now local #21544
Make time trigger data trigger.now local #21544
Conversation
If we're able to track down the cause, we should tag this PR for the 89 milestone. |
Thanks for reviewing! Now fixed by making sure we call the event handler with local time instead of converting to local time in the event handler: https://github.com/home-assistant/home-assistant/blob/e8f122c5518275dc93c1aaf4879113dd258c17c7/homeassistant/helpers/event.py#L373-L375 |
@@ -370,7 +370,9 @@ def pattern_time_change_listener(event): | |||
last_now = now | |||
|
|||
if next_time <= now: | |||
hass.async_run_job(action, event.data[ATTR_NOW]) | |||
if local: | |||
now = dt_util.as_local(now) |
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.
Does it matter that we now pass local time to calculate_next
?
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.
* Make time trigger data trigger.now local * Make time pattern trigger data trigger.now local * Lint * Rework according to review comment * Lint
Description:
Fix regression introduced by #17199 where time trigger is in local timezone but the time trigger data is in UTC. This fix changes back to previous behavior where both time trigger and the time trigger data is in local timezone
Related issue (if applicable): fixes #20110
Checklist:
tox
. Your PR cannot be merged unless tests pass