Add CO Detector (cobj) device support to Tuya (#58292)

This commit is contained in:
Franck Nijhof 2021-10-23 18:15:12 +02:00 committed by GitHub
parent 581d9ec281
commit 0a272669ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 3 deletions

View file

@ -14,6 +14,7 @@ from homeassistant.components.sensor import (
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
DEVICE_CLASS_CO,
DEVICE_CLASS_CO2,
DEVICE_CLASS_CURRENT,
DEVICE_CLASS_HUMIDITY,
@ -94,6 +95,17 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
),
*BATTERY_SENSORS,
),
# CO Detector
# https://developer.tuya.com/en/docs/iot/categorycobj?id=Kaiuz3u1j6q1v
"cobj": (
SensorEntityDescription(
key=DPCode.CO_VALUE,
name="Carbon Monoxide",
device_class=DEVICE_CLASS_CO,
state_class=STATE_CLASS_MEASUREMENT,
),
*BATTERY_SENSORS,
),
# Switch
# https://developer.tuya.com/en/docs/iot/s?id=K9gf7o5prgf7s
"kg": (