Use StrEnum in Tuya constants (#63073)
parent
f724aea0bb
commit
540ccc37b5
|
@ -3,11 +3,11 @@ from __future__ import annotations
|
||||||
|
|
||||||
from collections.abc import Callable
|
from collections.abc import Callable
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from enum import Enum
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from tuya_iot import TuyaCloudOpenAPIEndpoint
|
from tuya_iot import TuyaCloudOpenAPIEndpoint
|
||||||
|
|
||||||
|
from homeassistant.backports.enum import StrEnum
|
||||||
from homeassistant.components.sensor import SensorDeviceClass
|
from homeassistant.components.sensor import SensorDeviceClass
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
|
||||||
|
@ -98,7 +98,7 @@ PLATFORMS = [
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
class WorkMode(str, Enum):
|
class WorkMode(StrEnum):
|
||||||
"""Work modes."""
|
"""Work modes."""
|
||||||
|
|
||||||
COLOUR = "colour"
|
COLOUR = "colour"
|
||||||
|
@ -107,8 +107,8 @@ class WorkMode(str, Enum):
|
||||||
WHITE = "white"
|
WHITE = "white"
|
||||||
|
|
||||||
|
|
||||||
class DPCode(str, Enum):
|
class DPCode(StrEnum):
|
||||||
"""Device Property Codes used by Tuya.
|
"""Data Point Codes used by Tuya.
|
||||||
|
|
||||||
https://developer.tuya.com/en/docs/iot/standarddescription?id=K9i5ql6waswzq
|
https://developer.tuya.com/en/docs/iot/standarddescription?id=K9i5ql6waswzq
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue