Use StrEnum in Tuya constants (#63073)

pull/63092/head
Franck Nijhof 2021-12-30 19:23:27 +01:00 committed by GitHub
parent f724aea0bb
commit 540ccc37b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -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
""" """