Update typing 12 (#48073)

This commit is contained in:
Marc Mueller 2021-03-18 14:31:38 +01:00 committed by GitHub
parent 6cd6ad6904
commit a3cd1854f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
75 changed files with 399 additions and 312 deletions

View file

@ -1,8 +1,10 @@
"""Support for climate devices through the SmartThings cloud API."""
from __future__ import annotations
import asyncio
from collections.abc import Iterable
import logging
from typing import Optional, Sequence
from typing import Sequence
from pysmartthings import Attribute, Capability
@ -103,7 +105,7 @@ async def async_setup_entry(hass, config_entry, async_add_entities):
async_add_entities(entities, True)
def get_capabilities(capabilities: Sequence[str]) -> Optional[Sequence[str]]:
def get_capabilities(capabilities: Sequence[str]) -> Sequence[str] | None:
"""Return all capabilities supported if minimum required are present."""
supported = [
Capability.air_conditioner_mode,
@ -274,7 +276,7 @@ class SmartThingsThermostat(SmartThingsEntity, ClimateEntity):
return self._device.status.supported_thermostat_fan_modes
@property
def hvac_action(self) -> Optional[str]:
def hvac_action(self) -> str | None:
"""Return the current running hvac operation if supported."""
return OPERATING_STATE_TO_ACTION.get(
self._device.status.thermostat_operating_state