hass-core/tests/components/seventeentrack/__init__.py
Shai Ungar e0c785b2b4
Add coordinator to 17Track (#115057)
* Add coordinator to 17Track

* Add coordinator to 17Track

remove SensorEntityDescription (different PR)

* Update homeassistant/components/seventeentrack/coordinator.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/seventeentrack/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Add coordinator to 17Track

fix CR

* Add coordinator to 17Track

fix second CR

* Add coordinator to 17Track

remove commented out code + fix display name

* Add coordinator to 17Track

created a set outside _async_create_remove_entities function

* Add coordinator to 17Track

fix CR

* Add coordinator to 17Track

fix CR 2

* Update homeassistant/components/seventeentrack/coordinator.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Add coordinator to 17Track

raise UpdateFailed if API throws an exception

* Add coordinator to 17Track

merge calls

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-04-23 09:01:45 +02:00

28 lines
861 B
Python

"""Tests for the seventeentrack component."""
from datetime import timedelta
from freezegun.api import FrozenDateTimeFactory
from homeassistant.components.seventeentrack.const import DEFAULT_SCAN_INTERVAL
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry, async_fire_time_changed
async def init_integration(
hass: HomeAssistant,
config_entry: MockConfigEntry,
) -> None:
"""Set up the 17Track integration in Home Assistant."""
config_entry.add_to_hass(hass)
await hass.config_entries.async_setup(config_entry.entry_id)
await hass.async_block_till_done()
async def goto_future(hass: HomeAssistant, freezer: FrozenDateTimeFactory):
"""Move to future."""
freezer.tick(DEFAULT_SCAN_INTERVAL + timedelta(minutes=1))
async_fire_time_changed(hass)
await hass.async_block_till_done()