Allow configuring Starlink sleep schedule (#103057)

* Expose sleep config getters and setters

* Add a switch for toggling sleep schedule

* Add Time platform

* Add frozen to dataclasses

* Update tests

* Add starlink time to coveragerc

* No more mixin

* Update time.py

* Update time.py

* Run data collectors asynchronously

* Fix timezone handling
This commit is contained in:
Jack Boswell 2024-03-19 04:18:32 +13:00 committed by GitHub
parent e882d47cde
commit 34b0ff40f3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 204 additions and 13 deletions

View file

@ -5,7 +5,11 @@ from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import CONF_IP_ADDRESS
from homeassistant.core import HomeAssistant
from .patchers import LOCATION_DATA_SUCCESS_PATCHER, STATUS_DATA_SUCCESS_PATCHER
from .patchers import (
LOCATION_DATA_SUCCESS_PATCHER,
SLEEP_DATA_SUCCESS_PATCHER,
STATUS_DATA_SUCCESS_PATCHER,
)
from tests.common import MockConfigEntry
@ -17,7 +21,7 @@ async def test_successful_entry(hass: HomeAssistant) -> None:
data={CONF_IP_ADDRESS: "1.2.3.4:0000"},
)
with STATUS_DATA_SUCCESS_PATCHER, LOCATION_DATA_SUCCESS_PATCHER:
with STATUS_DATA_SUCCESS_PATCHER, LOCATION_DATA_SUCCESS_PATCHER, SLEEP_DATA_SUCCESS_PATCHER:
entry.add_to_hass(hass)
await hass.config_entries.async_setup(entry.entry_id)
@ -34,7 +38,7 @@ async def test_unload_entry(hass: HomeAssistant) -> None:
data={CONF_IP_ADDRESS: "1.2.3.4:0000"},
)
with STATUS_DATA_SUCCESS_PATCHER, LOCATION_DATA_SUCCESS_PATCHER:
with STATUS_DATA_SUCCESS_PATCHER, LOCATION_DATA_SUCCESS_PATCHER, SLEEP_DATA_SUCCESS_PATCHER:
entry.add_to_hass(hass)
await hass.config_entries.async_setup(entry.entry_id)