Add missing sensors to Tuya CO2 Detector (#131313)
parent
f095aea5c3
commit
6e8f3d9393
|
@ -292,6 +292,17 @@ NUMBERS: dict[str, tuple[NumberEntityDescription, ...]] = {
|
||||||
device_class=NumberDeviceClass.TEMPERATURE,
|
device_class=NumberDeviceClass.TEMPERATURE,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
# CO2 Detector
|
||||||
|
# https://developer.tuya.com/en/docs/iot/categoryco2bj?id=Kaiuz3wes7yuy
|
||||||
|
"co2bj": (
|
||||||
|
NumberEntityDescription(
|
||||||
|
key=DPCode.ALARM_TIME,
|
||||||
|
translation_key="alarm_duration",
|
||||||
|
native_unit_of_measurement=UnitOfTime.SECONDS,
|
||||||
|
device_class=NumberDeviceClass.DURATION,
|
||||||
|
entity_category=EntityCategory.CONFIG,
|
||||||
|
),
|
||||||
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -307,6 +307,15 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
|
||||||
entity_category=EntityCategory.CONFIG,
|
entity_category=EntityCategory.CONFIG,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
# CO2 Detector
|
||||||
|
# https://developer.tuya.com/en/docs/iot/categoryco2bj?id=Kaiuz3wes7yuy
|
||||||
|
"co2bj": (
|
||||||
|
SelectEntityDescription(
|
||||||
|
key=DPCode.ALARM_VOLUME,
|
||||||
|
translation_key="volume",
|
||||||
|
entity_category=EntityCategory.CONFIG,
|
||||||
|
),
|
||||||
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
# Socket (duplicate of `kg`)
|
# Socket (duplicate of `kg`)
|
||||||
|
|
|
@ -214,6 +214,12 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
|
||||||
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
|
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
),
|
),
|
||||||
|
TuyaSensorEntityDescription(
|
||||||
|
key=DPCode.PM25_VALUE,
|
||||||
|
translation_key="pm25",
|
||||||
|
device_class=SensorDeviceClass.PM25,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
),
|
||||||
*BATTERY_SENSORS,
|
*BATTERY_SENSORS,
|
||||||
),
|
),
|
||||||
# Two-way temperature and humidity switch
|
# Two-way temperature and humidity switch
|
||||||
|
|
|
@ -11,6 +11,7 @@ from homeassistant.components.siren import (
|
||||||
SirenEntityDescription,
|
SirenEntityDescription,
|
||||||
SirenEntityFeature,
|
SirenEntityFeature,
|
||||||
)
|
)
|
||||||
|
from homeassistant.const import EntityCategory
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
@ -43,6 +44,14 @@ SIRENS: dict[str, tuple[SirenEntityDescription, ...]] = {
|
||||||
key=DPCode.SIREN_SWITCH,
|
key=DPCode.SIREN_SWITCH,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
# CO2 Detector
|
||||||
|
# https://developer.tuya.com/en/docs/iot/categoryco2bj?id=Kaiuz3wes7yuy
|
||||||
|
"co2bj": (
|
||||||
|
SirenEntityDescription(
|
||||||
|
key=DPCode.ALARM_SWITCH,
|
||||||
|
entity_category=EntityCategory.CONFIG,
|
||||||
|
),
|
||||||
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -119,6 +119,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"number": {
|
"number": {
|
||||||
|
"alarm_duration": {
|
||||||
|
"name": "Alarm duration"
|
||||||
|
},
|
||||||
"temperature": {
|
"temperature": {
|
||||||
"name": "[%key:component::sensor::entity_component::temperature::name%]"
|
"name": "[%key:component::sensor::entity_component::temperature::name%]"
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue