Fix iCloud listeners (#76437)

pull/76464/head
epenet 2022-08-08 15:35:45 +02:00 committed by GitHub
parent fe9c101817
commit 3fcdad74fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View File

@ -17,7 +17,7 @@ from pyicloud.services.findmyiphone import AppleDevice
from homeassistant.components.zone import async_active_zone
from homeassistant.config_entries import SOURCE_REAUTH, ConfigEntry
from homeassistant.const import ATTR_ATTRIBUTION, CONF_USERNAME
from homeassistant.core import HomeAssistant
from homeassistant.core import CALLBACK_TYPE, HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.dispatcher import dispatcher_send
from homeassistant.helpers.event import track_point_in_utc_time
@ -104,6 +104,8 @@ class IcloudAccount:
self._retried_fetch = False
self._config_entry = config_entry
self.listeners: list[CALLBACK_TYPE] = []
def setup(self) -> None:
"""Set up an iCloud account."""
try:

View File

@ -34,7 +34,7 @@ async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None:
"""Set up device tracker for iCloud component."""
account = hass.data[DOMAIN][entry.unique_id]
account: IcloudAccount = hass.data[DOMAIN][entry.unique_id]
tracked = set[str]()
@callback

View File

@ -20,7 +20,7 @@ async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None:
"""Set up device tracker for iCloud component."""
account = hass.data[DOMAIN][entry.unique_id]
account: IcloudAccount = hass.data[DOMAIN][entry.unique_id]
tracked = set[str]()
@callback