Update typing 04 (#48037)

This commit is contained in:
Marc Mueller 2021-03-17 23:34:25 +01:00 committed by GitHub
parent 02619ca2cd
commit 76199c0eb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 282 additions and 229 deletions

View file

@ -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

View file

@ -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