Enable strict typing for deCONZ platforms binary_sensor+fan+logbook+number (#70171)
This commit is contained in:
parent
03874d1b65
commit
506be5a818
5 changed files with 58 additions and 22 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue