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:
parent
e882d47cde
commit
34b0ff40f3
11 changed files with 204 additions and 13 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue