Skip to content
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

Daylight savings does not trigger initialize() #2144

Open
rr326 opened this issue Nov 4, 2024 · 2 comments
Open

Daylight savings does not trigger initialize() #2144

rr326 opened this issue Nov 4, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@rr326
Copy link
Contributor

rr326 commented Nov 4, 2024

What happened?

From the docs, when Daylight savings time changes, it is supposed to re-run initialize(). I have some timers that did not re-initialized and hence the run_daily() were off by an hour. I also found the same issue reported in an appdaemon forum, so it's not just me.

Version

4.4.2

Installation type

Docker container

Relevant log output

2024-11-03 01:00:00 INFO     AppDaemon            Daylight Savings Time transition detected

(but no "intiailize" or reloaded apps after that.

Relevant code in the app or config file that caused the issue

self.run_daily(
                self.cb_gw_on,
                self.parse_time(config["schedule"]["time"]),
                config=config,
            )

Anything else?

This is in appdaemon scheduler.py

                if old_dst_offset != dst_offset:
                    #
                    # DST began or ended, lets prove we noticed
                    self.logger.info("Daylight Savings Time transition detected")
                    #
                    # Re calculate next entries
                    #
                    next_entries = self.get_next_entries()

Are you sure that elsewhere this actually triggers an intialize() per the docs?

@rr326 rr326 added the bug Something isn't working label Nov 4, 2024
@acockburn
Copy link
Member

acockburn commented Nov 4, 2024 via email

@rr326
Copy link
Contributor Author

rr326 commented Nov 4, 2024

Awesome that you responded so quickly. Thanks Andrew.

Just re-calling initialize sounds like a good solution to me. Not the most efficient or fast, but it only happens twice a year, and simplicity on your end seems a win!

(I was literally thinking of implementing an app to kill appdaemon upon a transition, so it would be forced to reload.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants