Ejemplo n.º 1
0
 def __init__(self, hass: HomeAssistant, device: Device):
     """Initialize the data update coordinator."""
     DataUpdateCoordinator.__init__(
         self,
         hass,
         _LOGGER,
         name=f"{DOMAIN}-{device.device_info.name}",
         update_interval=timedelta(seconds=60),
     )
     self.device = device
     self._error_count = 0
Ejemplo n.º 2
0
 def __init__(self, hass, logger, update_interval, container):
     """Initialize the data update coordinator."""
     DataUpdateCoordinator.__init__(
         self,
         hass,
         logger,
         name="container stats for '{}'".format(container.name),
         update_interval=update_interval,
         update_method=self.async_update_data
     )
     self._container = container
Ejemplo n.º 3
0
 def __init__(self, hass, logger, update_interval, docker_api):
     """Initialize the data update coordinator."""
     DataUpdateCoordinator.__init__(
         self,
         hass,
         logger,
         name="docker util",
         update_interval=update_interval,
         update_method=self.async_update_data
     )
     self._docker_api = docker_api
Ejemplo n.º 4
0
 def __init__(self, hass, cloud: MiCloud):
     """Initialize the data update coordinator."""
     DataUpdateCoordinator.__init__(
         self,
         hass,
         _LOGGER,
         name=f"{DOMAIN}-{cloud.auth['user_id']}",
         update_interval=timedelta(seconds=6),
     )
     self._cloud_instance = cloud
     self._error_count = 0
     self._fixed_list = []
     self._waiting_list = []  # 请求的params
     self._results = {}
Ejemplo n.º 5
0
 def __init__(self, hass, cloud: MiCloud, cloud_config, item):
     """Initialize the data update coordinator."""
     DataUpdateCoordinator.__init__(
         self,
         hass,
         _LOGGER,
         name=f"{DOMAIN}-{cloud.auth['user_id']}-event-{item[0]}",
         update_interval=timedelta(seconds=6),
     )
     self._cloud_instance = cloud
     self._cloud = cloud_config
     # self._mapping = mapping
     self._item = item
     self._error_count = 0
     self._results = {}
Ejemplo n.º 6
0
 def __init__(
     self,
     hass: HomeAssistant,
     logger: logging.Logger,
     api: AbstractGateApi,
     *,
     name: str,
     update_interval: timedelta,
     update_method: Callable[[], Awaitable] | None = None,
     request_refresh_debouncer: Debouncer | None = None,
 ) -> None:
     """Initialize the data update coordinator."""
     DataUpdateCoordinator.__init__(
         self,
         hass,
         logger,
         name=name,
         update_interval=update_interval,
         update_method=update_method,
         request_refresh_debouncer=request_refresh_debouncer,
     )
     self.api = api
Ejemplo n.º 7
0
 def __init__(
     self,
     hass: HomeAssistant,
     logger: logging.Logger,
     api: GogoGate2Api,
     *,
     name: str,
     update_interval: timedelta,
     update_method: Optional[Callable[[], Awaitable]] = None,
     request_refresh_debouncer: Optional[Debouncer] = None,
 ):
     """Initialize the data update coordinator."""
     DataUpdateCoordinator.__init__(
         self,
         hass,
         logger,
         name=name,
         update_interval=update_interval,
         update_method=update_method,
         request_refresh_debouncer=request_refresh_debouncer,
     )
     self.api = api