Update typing 13 (#48077)

This commit is contained in:
Marc Mueller 2021-03-18 14:43:52 +01:00 committed by GitHub
parent a3cd1854f6
commit b67b9b94f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 287 additions and 226 deletions

View file

@ -1,5 +1,7 @@
"""Support for Vera switches."""
from typing import Any, Callable, List, Optional
from __future__ import annotations
from typing import Any, Callable
import pyvera as veraApi
@ -20,7 +22,7 @@ from .common import ControllerData, get_controller_data
async def async_setup_entry(
hass: HomeAssistant,
entry: ConfigEntry,
async_add_entities: Callable[[List[Entity], bool], None],
async_add_entities: Callable[[list[Entity], bool], None],
) -> None:
"""Set up the sensor config entry."""
controller_data = get_controller_data(hass, entry)
@ -57,7 +59,7 @@ class VeraSwitch(VeraDevice[veraApi.VeraSwitch], SwitchEntity):
self.schedule_update_ha_state()
@property
def current_power_w(self) -> Optional[float]:
def current_power_w(self) -> float | None:
"""Return the current power usage in W."""
power = self.vera_device.power
if power: