Improve typing [helpers.entity] (#70890)
parent
385f199691
commit
283c04e424
|
@ -16,6 +16,7 @@ homeassistant.auth.providers.*
|
|||
homeassistant.helpers.area_registry
|
||||
homeassistant.helpers.condition
|
||||
homeassistant.helpers.discovery
|
||||
homeassistant.helpers.entity
|
||||
homeassistant.helpers.entity_values
|
||||
homeassistant.helpers.event
|
||||
homeassistant.helpers.reload
|
||||
|
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
|||
|
||||
from abc import ABC
|
||||
import asyncio
|
||||
from collections.abc import Awaitable, Iterable, Mapping, MutableMapping
|
||||
from collections.abc import Coroutine, Iterable, Mapping, MutableMapping
|
||||
from dataclasses import dataclass
|
||||
from datetime import datetime, timedelta
|
||||
from enum import Enum, auto
|
||||
|
@ -621,7 +621,7 @@ class Entity(ABC):
|
|||
if DATA_CUSTOMIZE in self.hass.data:
|
||||
attr.update(self.hass.data[DATA_CUSTOMIZE].get(self.entity_id))
|
||||
|
||||
def _convert_temperature(state: str, attr: dict) -> str:
|
||||
def _convert_temperature(state: str, attr: dict[str, Any]) -> str:
|
||||
# Convert temperature if we detect one
|
||||
# pylint: disable-next=import-outside-toplevel
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
|
@ -958,7 +958,7 @@ class Entity(ABC):
|
|||
"""Return the representation."""
|
||||
return f"<Entity {self.name}: {self.state}>"
|
||||
|
||||
async def async_request_call(self, coro: Awaitable) -> None:
|
||||
async def async_request_call(self, coro: Coroutine[Any, Any, Any]) -> None:
|
||||
"""Process request batched."""
|
||||
if self.parallel_updates:
|
||||
await self.parallel_updates.acquire()
|
||||
|
|
Loading…
Reference in New Issue