mirror of
https://github.com/home-assistant/core.git
synced 2025-04-28 03:07:50 +00:00

* Cleanup for apsystems and fix for strings * Migrate to typed ConfigEntry Data for apsystems * Improve strings for apsystems * Improve config flow tests for apsystems by cleaning up fixtures * Do not use Dataclass for Config Entry Typing * Improve translations for apsystems by using sentence case and removing an apostrophe * Rename test fixture and remove unnecessary comment in tests from apsystems * Remove default override with default in coordinator from apsystems
30 lines
859 B
Python
30 lines
859 B
Python
"""The coordinator for APsystems local API integration."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from datetime import timedelta
|
|
|
|
from APsystemsEZ1 import APsystemsEZ1M, ReturnOutputData
|
|
|
|
from homeassistant.core import HomeAssistant
|
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
|
|
|
from .const import LOGGER
|
|
|
|
|
|
class ApSystemsDataCoordinator(DataUpdateCoordinator[ReturnOutputData]):
|
|
"""Coordinator used for all sensors."""
|
|
|
|
def __init__(self, hass: HomeAssistant, api: APsystemsEZ1M) -> None:
|
|
"""Initialize my coordinator."""
|
|
super().__init__(
|
|
hass,
|
|
LOGGER,
|
|
name="APSystems Data",
|
|
update_interval=timedelta(seconds=12),
|
|
)
|
|
self.api = api
|
|
|
|
async def _async_update_data(self) -> ReturnOutputData:
|
|
return await self.api.get_output_data()
|