Extend hjjcy device category in Tuya integration (#124854)

* Extend hjjcy device category in Tuya integration

* Better AQI level names
This commit is contained in:
Dmitry Krasnoukhov 2024-09-01 18:50:53 +03:00 committed by GitHub
parent 5f2964d3e8
commit bd6b5568eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 27 additions and 1 deletions

View File

@ -96,6 +96,7 @@ class DPCode(StrEnum):
"""
AIR_QUALITY = "air_quality"
AIR_QUALITY_INDEX = "air_quality_index"
ALARM_SWITCH = "alarm_switch" # Alarm switch
ALARM_TIME = "alarm_time" # Alarm time
ALARM_VOLUME = "alarm_volume" # Alarm volume

View File

@ -236,6 +236,9 @@
},
"air_quality": {
"default": "mdi:air-filter"
},
"air_quality_index": {
"default": "mdi:air-filter"
}
},
"switch": {

View File

@ -264,8 +264,12 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
),
),
# Air Quality Monitor
# No specification on Tuya portal
# https://developer.tuya.com/en/docs/iot/hjjcy?id=Kbeoad8y1nnlv
"hjjcy": (
TuyaSensorEntityDescription(
key=DPCode.AIR_QUALITY_INDEX,
translation_key="air_quality_index",
),
TuyaSensorEntityDescription(
key=DPCode.TEMP_CURRENT,
translation_key="temperature",
@ -301,6 +305,13 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
device_class=SensorDeviceClass.PM25,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.PM10,
translation_key="pm10",
device_class=SensorDeviceClass.PM10,
state_class=SensorStateClass.MEASUREMENT,
),
*BATTERY_SENSORS,
),
# Formaldehyde Detector
# Note: Not documented

View File

@ -620,6 +620,17 @@
"good": "Good",
"severe": "Severe"
}
},
"air_quality_index": {
"name": "Air quality index",
"state": {
"level_1": "Level 1",
"level_2": "Level 2",
"level_3": "Level 3",
"level_4": "Level 4",
"level_5": "Level 5",
"level_6": "Level 6"
}
}
},
"switch": {