Update typing 04 (#48037)
This commit is contained in:
parent
02619ca2cd
commit
76199c0eb2
44 changed files with 282 additions and 229 deletions
|
@ -1,5 +1,5 @@
|
|||
"""Implement device conditions for binary sensor."""
|
||||
from typing import Dict, List
|
||||
from __future__ import annotations
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
|
@ -205,9 +205,9 @@ CONDITION_SCHEMA = cv.DEVICE_CONDITION_BASE_SCHEMA.extend(
|
|||
|
||||
async def async_get_conditions(
|
||||
hass: HomeAssistant, device_id: str
|
||||
) -> List[Dict[str, str]]:
|
||||
) -> list[dict[str, str]]:
|
||||
"""List device conditions."""
|
||||
conditions: List[Dict[str, str]] = []
|
||||
conditions: list[dict[str, str]] = []
|
||||
entity_registry = await async_get_registry(hass)
|
||||
entries = [
|
||||
entry
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
"""Helper to test significant Binary Sensor state changes."""
|
||||
from typing import Any, Optional
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
|
||||
|
@ -12,7 +14,7 @@ def async_check_significant_change(
|
|||
new_state: str,
|
||||
new_attrs: dict,
|
||||
**kwargs: Any,
|
||||
) -> Optional[bool]:
|
||||
) -> bool | None:
|
||||
"""Test if state significantly changed."""
|
||||
if old_state != new_state:
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue