1
mirror of https://github.com/home-assistant/core synced 2024-09-06 10:29:55 +02:00

Add Pressure Sensor (ylcg) device support to Tuya (#58294)

This commit is contained in:
Franck Nijhof 2021-10-23 18:16:28 +02:00 committed by GitHub
parent 3cdfb84b79
commit 7d0fc8ca98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 0 deletions

View File

@ -161,6 +161,15 @@ BINARY_SENSORS: dict[str, tuple[TuyaBinarySensorEntityDescription, ...]] = {
),
TAMPER_BINARY_SENSOR,
),
# Pressure Sensor
# https://developer.tuya.com/en/docs/iot/categoryylcg?id=Kaiuz3kc2e4gm
"ylcg": (
TuyaBinarySensorEntityDescription(
key=DPCode.PRESSURE_STATE,
on_value="alarm",
),
TAMPER_BINARY_SENSOR,
),
# Smoke Detector
# https://developer.tuya.com/en/docs/iot/categoryywbj?id=Kaiuz3f6sf952
"ywbj": (

View File

@ -206,6 +206,8 @@ class DPCode(str, Enum):
POWDER_SET = "powder_set" # Powder
POWER_GO = "power_go"
PRESENCE_STATE = "presence_state"
PRESSURE_STATE = "pressure_state"
PRESSURE_VALUE = "pressure_value"
PUMP_RESET = "pump_reset" # Water pump reset
RECORD_SWITCH = "record_switch" # Recording switch
RELAY_STATUS = "relay_status"

View File

@ -21,6 +21,7 @@ from homeassistant.const import (
DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_PM25,
DEVICE_CLASS_POWER,
DEVICE_CLASS_PRESSURE,
DEVICE_CLASS_TEMPERATURE,
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS,
DEVICE_CLASS_VOLTAGE,
@ -227,6 +228,16 @@ SENSORS: dict[str, tuple[SensorEntityDescription, ...]] = {
# Emergency Button
# https://developer.tuya.com/en/docs/iot/categorysos?id=Kaiuz3oi6agjy
"sos": BATTERY_SENSORS,
# Pressure Sensor
# https://developer.tuya.com/en/docs/iot/categoryylcg?id=Kaiuz3kc2e4gm
"ylcg": (
SensorEntityDescription(
key=DPCode.PRESSURE_VALUE,
device_class=DEVICE_CLASS_PRESSURE,
state_class=STATE_CLASS_MEASUREMENT,
),
*BATTERY_SENSORS,
),
# Smoke Detector
# https://developer.tuya.com/en/docs/iot/categoryywbj?id=Kaiuz3f6sf952
"ywbj": (