Adjust type hints in CloudClient (#92465)

This commit is contained in:
Erik Montnemery 2023-05-04 12:26:52 +02:00 committed by GitHub
parent 46bf0e59f3
commit 78da1168db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,7 +76,7 @@ class CloudClient(Interface):
return self._hass.http.runner
@property
def cloudhooks(self) -> dict[str, dict[str, str]]:
def cloudhooks(self) -> dict[str, dict[str, str | bool]]:
"""Return list of cloudhooks."""
return self._prefs.cloudhooks
@ -97,8 +97,6 @@ class CloudClient(Interface):
if self._alexa_config is not None:
return self._alexa_config
assert self.cloud is not None
cloud_user = await self._prefs.get_cloud_user()
alexa_conf = alexa_config.CloudAlexaConfig(
@ -120,8 +118,6 @@ class CloudClient(Interface):
if self._google_config is not None:
return self._google_config
assert self.cloud is not None
cloud_user = await self._prefs.get_cloud_user()
google_conf = google_config.CloudGoogleConfig(
@ -270,6 +266,8 @@ class CloudClient(Interface):
if payload and (region := payload.get("region")):
self._relayer_region = region
async def async_cloudhooks_update(self, data: dict[str, dict[str, str]]) -> None:
async def async_cloudhooks_update(
self, data: dict[str, dict[str, str | bool]]
) -> None:
"""Update local list of cloudhooks."""
await self._prefs.async_update(cloudhooks=data)