diff --git a/homeassistant/components/tuya/binary_sensor.py b/homeassistant/components/tuya/binary_sensor.py index 33a0eef3572..a8627d17eae 100644 --- a/homeassistant/components/tuya/binary_sensor.py +++ b/homeassistant/components/tuya/binary_sensor.py @@ -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": ( diff --git a/homeassistant/components/tuya/const.py b/homeassistant/components/tuya/const.py index 0f42bc9265c..99f1757c4af 100644 --- a/homeassistant/components/tuya/const.py +++ b/homeassistant/components/tuya/const.py @@ -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" diff --git a/homeassistant/components/tuya/sensor.py b/homeassistant/components/tuya/sensor.py index eddbd650688..19bb2ff6a90 100644 --- a/homeassistant/components/tuya/sensor.py +++ b/homeassistant/components/tuya/sensor.py @@ -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": (