From fe5d4c55645320f3db880585ffc946529ef0f724 Mon Sep 17 00:00:00 2001 From: spacemanspiff2007 <10754716+spacemanspiff2007@users.noreply.github.com> Date: Tue, 9 Jan 2024 14:58:09 +0100 Subject: [PATCH] Update docs --- docs/class_reference.rst | 16 ++++++++-------- src/HABApp/rule/scheduler/jobs.py | 22 ++++++++++++++-------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/docs/class_reference.rst b/docs/class_reference.rst index 054df370..b9846e13 100644 --- a/docs/class_reference.rst +++ b/docs/class_reference.rst @@ -33,7 +33,7 @@ Scheduler OneTimeJob """""""""""""""""""""""""""""""""""""" -.. autoclass:: eascheduler.scheduler_view.OneTimeJob +.. autoclass:: HABApp.rule.scheduler.jobs.OneTimeJob :members: :inherited-members: :member-order: groupwise @@ -41,7 +41,7 @@ OneTimeJob CountdownJob """""""""""""""""""""""""""""""""""""" -.. autoclass:: eascheduler.scheduler_view.CountdownJob +.. autoclass:: HABApp.rule.scheduler.jobs.CountdownJob :members: :inherited-members: :member-order: groupwise @@ -49,7 +49,7 @@ CountdownJob ReoccurringJob """""""""""""""""""""""""""""""""""""" -.. autoclass:: eascheduler.scheduler_view.ReoccurringJob +.. autoclass:: HABApp.rule.scheduler.jobs.ReoccurringJob :members: :inherited-members: :member-order: groupwise @@ -57,7 +57,7 @@ ReoccurringJob DayOfWeekJob """""""""""""""""""""""""""""""""""""" -.. autoclass:: eascheduler.scheduler_view.DayOfWeekJob +.. autoclass:: HABApp.rule.scheduler.jobs.DayOfWeekJob :members: :inherited-members: :member-order: groupwise @@ -65,7 +65,7 @@ DayOfWeekJob DawnJob """""""""""""""""""""""""""""""""""""" -.. autoclass:: eascheduler.scheduler_view.DawnJob +.. autoclass:: HABApp.rule.scheduler.jobs.DawnJob :members: :inherited-members: :member-order: groupwise @@ -73,7 +73,7 @@ DawnJob SunriseJob """""""""""""""""""""""""""""""""""""" -.. autoclass:: eascheduler.scheduler_view.SunriseJob +.. autoclass:: HABApp.rule.scheduler.jobs.SunriseJob :members: :inherited-members: :member-order: groupwise @@ -81,7 +81,7 @@ SunriseJob SunsetJob """""""""""""""""""""""""""""""""""""" -.. autoclass:: eascheduler.scheduler_view.SunsetJob +.. autoclass:: HABApp.rule.scheduler.jobs.SunsetJob :members: :inherited-members: :member-order: groupwise @@ -89,7 +89,7 @@ SunsetJob DuskJob """""""""""""""""""""""""""""""""""""" -.. autoclass:: eascheduler.scheduler_view.DuskJob +.. autoclass:: HABApp.rule.scheduler.jobs.DuskJob :members: :inherited-members: :member-order: groupwise diff --git a/src/HABApp/rule/scheduler/jobs.py b/src/HABApp/rule/scheduler/jobs.py index 9608a195..3b3c9466 100644 --- a/src/HABApp/rule/scheduler/jobs.py +++ b/src/HABApp/rule/scheduler/jobs.py @@ -3,17 +3,22 @@ import inspect import eascheduler.scheduler_view +from eascheduler.const import FAR_FUTURE +from eascheduler.jobs import CountdownJob as CountdownJobBase +from eascheduler.jobs import DawnJob as DawnJobBase +from eascheduler.jobs import DayOfWeekJob as DayOfWeekJobBase +from eascheduler.jobs import DuskJob as DuskJobBase +from eascheduler.jobs import OneTimeJob as OneTimeJobBase +from eascheduler.jobs import ReoccurringJob as ReoccurringJobBase +from eascheduler.jobs import SunriseJob as SunriseJobBase +from eascheduler.jobs import SunsetJob as SunsetJobBase +from eascheduler.jobs.job_base import ScheduledJobBase + from HABApp.core.internals import uses_item_registry from HABApp.core.items import BaseValueItem from HABApp.core.wrapper import ignore_exception from HABApp.openhab.items import OpenhabItem -from eascheduler.const import FAR_FUTURE -from eascheduler.jobs import ( - CountdownJob as CountdownJobBase, DawnJob as DawnJobBase, DayOfWeekJob as DayOfWeekJobBase, - DuskJob as DuskJobBase, OneTimeJob as OneTimeJobBase, ReoccurringJob as ReoccurringJobBase, - SunriseJob as SunriseJobBase, SunsetJob as SunsetJobBase -) -from eascheduler.jobs.job_base import ScheduledJobBase + Items = uses_item_registry() @@ -45,8 +50,9 @@ def _timestamp_to_item(self, job: ScheduledJobBase): def to_item(self, item: str | BaseValueItem | None): """Sends the next execution (date)time to an item. Sends ``None`` if the job is not scheduled. + Every time the scheduler updates to a new (date)time the item will also receive the updated time. - :param item: item name or item, None to disable + :param item: item name or item, ``None`` to disable """ if item is None: self._item = None