Skip to content

Commit

Permalink
Dev4
Browse files Browse the repository at this point in the history
  • Loading branch information
spacemanspiff2007 committed Sep 29, 2024
1 parent ce56f68 commit 3c45df8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/HABApp/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
# Development versions contain the DEV-COUNTER postfix:
# - 24.01.0.DEV-1

__version__ = '24.09.0.DEV-3'
__version__ = '24.09.0.DEV-4'
1 change: 1 addition & 0 deletions src/HABApp/rule/interfaces/http_interface.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from HABApp.rule.interfaces._http import delete, get, get_client_session, post, put
9 changes: 9 additions & 0 deletions src/HABApp/rule/scheduler/job_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import random
import warnings
from collections.abc import Callable, Hashable, Iterable, Mapping
from datetime import datetime as dt_datetime
from typing import TYPE_CHECKING, Any, Final, TypeAlias

from eascheduler.builder import FilterBuilder, JobBuilder, TriggerBuilder
Expand Down Expand Up @@ -179,6 +180,10 @@ def on_day_of_week(self, time, weekdays,
'self.run.on_day_of_week is deprecated. Use self.run.at in combination with a trigger and a filter',
DeprecationWarning, stacklevel=2
)

if isinstance(time, dt_datetime):
time = time.time()

return self.at(
TriggerBuilder.time(time).only_at(FilterBuilder.weekdays(weekdays)),
callback, *args, **kwargs
Expand All @@ -190,6 +195,10 @@ def on_every_day(self, time, callback: HINT_CB,
'self.run.on_every_day is deprecated. Use self.run.at in combination with a trigger',
DeprecationWarning, stacklevel=2
)

if isinstance(time, dt_datetime):
time = time.time()

return self.at(
TriggerBuilder.time(time),
callback, *args, **kwargs
Expand Down

0 comments on commit 3c45df8

Please sign in to comment.