1 """Coordinator for handling data fetching and updates."""
3 from __future__
import annotations
6 from typing
import TYPE_CHECKING, Any
8 from madvr.madvr
import Madvr
13 from .const
import DOMAIN
15 _LOGGER = logging.getLogger(__name__)
18 from .
import MadVRConfigEntry
22 """Madvr coordinator for Envy (push-based API)."""
24 config_entry: MadVRConfigEntry
31 """Initialize madvr coordinator."""
32 super().
__init__(hass, _LOGGER, name=DOMAIN)
40 _LOGGER.debug(
"MadVRCoordinator initialized with mac: %s", self.
macmac)
43 """Handle new data pushed from the API."""
44 _LOGGER.debug(
"Received push data: %s", data)
49 """Handle operations on integration load."""
50 _LOGGER.debug(
"Using loop: %s", self.
clientclient.loop)
52 await self.
clientclient.async_add_tasks()
53 _LOGGER.debug(
"Added %s tasks to client", len(self.
clientclient.tasks))
None handle_coordinator_load(self)
None __init__(self, HomeAssistant hass, Madvr client)
None handle_push_data(self, dict[str, Any] data)
None async_set_updated_data(self, _DataT data)