mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 07:07:28 +00:00
Extend hjjcy device category in Tuya integration (#124854)
* Extend hjjcy device category in Tuya integration * Better AQI level names
This commit is contained in:
parent
5f2964d3e8
commit
bd6b5568eb
@ -96,6 +96,7 @@ class DPCode(StrEnum):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
AIR_QUALITY = "air_quality"
|
AIR_QUALITY = "air_quality"
|
||||||
|
AIR_QUALITY_INDEX = "air_quality_index"
|
||||||
ALARM_SWITCH = "alarm_switch" # Alarm switch
|
ALARM_SWITCH = "alarm_switch" # Alarm switch
|
||||||
ALARM_TIME = "alarm_time" # Alarm time
|
ALARM_TIME = "alarm_time" # Alarm time
|
||||||
ALARM_VOLUME = "alarm_volume" # Alarm volume
|
ALARM_VOLUME = "alarm_volume" # Alarm volume
|
||||||
|
@ -236,6 +236,9 @@
|
|||||||
},
|
},
|
||||||
"air_quality": {
|
"air_quality": {
|
||||||
"default": "mdi:air-filter"
|
"default": "mdi:air-filter"
|
||||||
|
},
|
||||||
|
"air_quality_index": {
|
||||||
|
"default": "mdi:air-filter"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"switch": {
|
"switch": {
|
||||||
|
@ -264,8 +264,12 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
# Air Quality Monitor
|
# Air Quality Monitor
|
||||||
# No specification on Tuya portal
|
# https://developer.tuya.com/en/docs/iot/hjjcy?id=Kbeoad8y1nnlv
|
||||||
"hjjcy": (
|
"hjjcy": (
|
||||||
|
TuyaSensorEntityDescription(
|
||||||
|
key=DPCode.AIR_QUALITY_INDEX,
|
||||||
|
translation_key="air_quality_index",
|
||||||
|
),
|
||||||
TuyaSensorEntityDescription(
|
TuyaSensorEntityDescription(
|
||||||
key=DPCode.TEMP_CURRENT,
|
key=DPCode.TEMP_CURRENT,
|
||||||
translation_key="temperature",
|
translation_key="temperature",
|
||||||
@ -301,6 +305,13 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
|
|||||||
device_class=SensorDeviceClass.PM25,
|
device_class=SensorDeviceClass.PM25,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
|
TuyaSensorEntityDescription(
|
||||||
|
key=DPCode.PM10,
|
||||||
|
translation_key="pm10",
|
||||||
|
device_class=SensorDeviceClass.PM10,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
),
|
||||||
|
*BATTERY_SENSORS,
|
||||||
),
|
),
|
||||||
# Formaldehyde Detector
|
# Formaldehyde Detector
|
||||||
# Note: Not documented
|
# Note: Not documented
|
||||||
|
@ -620,6 +620,17 @@
|
|||||||
"good": "Good",
|
"good": "Good",
|
||||||
"severe": "Severe"
|
"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": {
|
"switch": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user