mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 02:49:40 +00:00
Update typing 05 (#48038)
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
"""Interface implementation for cloud client."""
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
import logging
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict
|
||||
from typing import Any
|
||||
|
||||
import aiohttp
|
||||
from hass_nabucasa.client import CloudClient as Interface
|
||||
@@ -32,8 +34,8 @@ class CloudClient(Interface):
|
||||
hass: HomeAssistantType,
|
||||
prefs: CloudPreferences,
|
||||
websession: aiohttp.ClientSession,
|
||||
alexa_user_config: Dict[str, Any],
|
||||
google_user_config: Dict[str, Any],
|
||||
alexa_user_config: dict[str, Any],
|
||||
google_user_config: dict[str, Any],
|
||||
):
|
||||
"""Initialize client interface to Cloud."""
|
||||
self._hass = hass
|
||||
@@ -70,7 +72,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]]:
|
||||
"""Return list of cloudhooks."""
|
||||
return self._prefs.cloudhooks
|
||||
|
||||
@@ -164,7 +166,7 @@ class CloudClient(Interface):
|
||||
if identifier.startswith("remote_"):
|
||||
async_dispatcher_send(self._hass, DISPATCHER_REMOTE_UPDATE, data)
|
||||
|
||||
async def async_alexa_message(self, payload: Dict[Any, Any]) -> Dict[Any, Any]:
|
||||
async def async_alexa_message(self, payload: dict[Any, Any]) -> dict[Any, Any]:
|
||||
"""Process cloud alexa message to client."""
|
||||
cloud_user = await self._prefs.get_cloud_user()
|
||||
aconfig = await self.get_alexa_config()
|
||||
@@ -176,7 +178,7 @@ class CloudClient(Interface):
|
||||
enabled=self._prefs.alexa_enabled,
|
||||
)
|
||||
|
||||
async def async_google_message(self, payload: Dict[Any, Any]) -> Dict[Any, Any]:
|
||||
async def async_google_message(self, payload: dict[Any, Any]) -> dict[Any, Any]:
|
||||
"""Process cloud google message to client."""
|
||||
if not self._prefs.google_enabled:
|
||||
return ga.turned_off_response(payload)
|
||||
@@ -187,7 +189,7 @@ class CloudClient(Interface):
|
||||
self._hass, gconf, gconf.cloud_user, payload, gc.SOURCE_CLOUD
|
||||
)
|
||||
|
||||
async def async_webhook_message(self, payload: Dict[Any, Any]) -> Dict[Any, Any]:
|
||||
async def async_webhook_message(self, payload: dict[Any, Any]) -> dict[Any, Any]:
|
||||
"""Process cloud webhook message to client."""
|
||||
cloudhook_id = payload["cloudhook_id"]
|
||||
|
||||
@@ -221,6 +223,6 @@ class CloudClient(Interface):
|
||||
"headers": {"Content-Type": response.content_type},
|
||||
}
|
||||
|
||||
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]]) -> None:
|
||||
"""Update local list of cloudhooks."""
|
||||
await self._prefs.async_update(cloudhooks=data)
|
||||
|
||||
Reference in New Issue
Block a user