Enable strict typing for deCONZ platforms binary_sensor+fan+logbook+number (#70171)

This commit is contained in:
Robert Svensson 2022-04-19 10:32:57 +02:00 committed by GitHub
parent 03874d1b65
commit 506be5a818
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 58 additions and 22 deletions

View file

@ -1,7 +1,7 @@
"""Support for deCONZ fans."""
from __future__ import annotations
from typing import Any
from typing import Any, Literal
from pydeconz.light import (
FAN_SPEED_25_PERCENT,
@ -25,7 +25,7 @@ from homeassistant.util.percentage import (
from .deconz_device import DeconzDevice
from .gateway import DeconzGateway, get_gateway_from_config_entry
ORDERED_NAMED_FAN_SPEEDS = [
ORDERED_NAMED_FAN_SPEEDS: list[Literal[0, 1, 2, 3, 4, 5, 6]] = [
FAN_SPEED_25_PERCENT,
FAN_SPEED_50_PERCENT,
FAN_SPEED_75_PERCENT,
@ -77,6 +77,7 @@ class DeconzFan(DeconzDevice, FanEntity):
TYPE = DOMAIN
_device: Fan
_default_on_speed: Literal[0, 1, 2, 3, 4, 5, 6]
_attr_supported_features = FanEntityFeature.SET_SPEED