Update typing syntax (#49480)

* Update typing syntax

* Replace typing imports with ones from collections where possible

* Changes after review
This commit is contained in:
Marc Mueller 2021-04-20 17:40:41 +02:00 committed by GitHub
parent 34245c3add
commit c07646db5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
136 changed files with 284 additions and 168 deletions

View file

@ -1,8 +1,9 @@
"""The sma integration."""
from __future__ import annotations
import asyncio
from datetime import timedelta
import logging
from typing import List
import pysma
@ -40,7 +41,7 @@ from .const import (
_LOGGER = logging.getLogger(__name__)
def _parse_legacy_options(entry: ConfigEntry, sensor_def: pysma.Sensors) -> List[str]:
def _parse_legacy_options(entry: ConfigEntry, sensor_def: pysma.Sensors) -> list[str]:
"""Parse legacy configuration options.
This will parse the legacy CONF_SENSORS and CONF_CUSTOM configuration options
@ -89,7 +90,7 @@ def _migrate_old_unique_ids(
hass: HomeAssistant,
entry: ConfigEntry,
sensor_def: pysma.Sensors,
config_sensors: List[str],
config_sensors: list[str],
) -> None:
"""Migrate legacy sensor entity_id format to new format."""
entity_registry = er.async_get(hass)