Update typing 13 (#48077)
This commit is contained in:
parent
a3cd1854f6
commit
b67b9b94f9
51 changed files with 287 additions and 226 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue