Skip to content

Handling of datetime.time() when scheduling run_daily() changed between 4.4.2 and 4.5.5 #2338

@pseudoacacia

Description

@pseudoacacia

What happened?

I have a handful of daily tasks scheduled using run_daily(). Those tasks were set like this:

self.ad.run_daily(self.turn_lights, time(23, 59, 0), state="OFF")

Where time(23, 59, 0) used to result in the callback being scheduled for 11:59 p.m. local time. Since changing to 4.5.5, that is running at 11:59 p.m. UTC instead.

Switching the call to use a string yields the desired behavior:

self.ad.run_daily(self.turn_lights, "23:59:00", state="OFF")

I've changed all my calls to use the string parameter, so it no longer affects me. I can see an argument for either behavior, but if left as it currently is it would constitute a breaking change.

Version

4.5.5

Installation type

Docker container

Relevant log output

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

Anything else?

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions