diff --git a/devices_schedules_restart_handler.yaml b/devices_schedules_restart_handler.yaml index 3c925c0..48f7242 100644 --- a/devices_schedules_restart_handler.yaml +++ b/devices_schedules_restart_handler.yaml @@ -71,7 +71,7 @@ mode: queued max_exceeded: silent variables: - version: 20260222 + version: 20260507 triggers: - trigger: homeassistant @@ -80,6 +80,11 @@ triggers: conditions: [] actions: + - wait_template: "{{ is_state('binary_sensor.pyscript_common_utilities', 'on') }}" + timeout: + seconds: 60 + continue_on_timeout: true + - variables: _index_key: !input registry_index_key _prefix: !input registry_timer_prefix diff --git a/pyproject.toml b/pyproject.toml index d7a0fb1..ab1bb3b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,8 +11,8 @@ dev = [ "beautifulsoup4", "curl-cffi", "google-api-python-client", - "h2", - "homeassistant>=2026.4.0", + "h2>=4,<5", + "homeassistant>=2026.5.0", "ruff", ] diff --git a/scripts/common_utilities.py b/scripts/common_utilities.py index a15aab0..14dfe45 100644 --- a/scripts/common_utilities.py +++ b/scripts/common_utilities.py @@ -246,6 +246,15 @@ async def initialize_cache_db() -> None: """Initialize cache and prune expired entries on startup.""" await _cache_prepare_db(force=True) await _prune_expired() + state.set( # noqa: F821 + f"binary_sensor.pyscript_{__name__}", + "on", + { + "friendly_name": f"Pyscript {__name__.replace('_', ' ').title()}", + "device_class": "connectivity", + }, + ) + log.info(f"Pyscript {__name__} is ready.") # noqa: F821 @time_trigger("cron(0 * * * *)") # noqa: F821