Fix Tuya unsupported Temperature & Humidity Sensors (with or without external probe) (#138542)
* add category qxj for th sensor with external probe. partly fixes #136472 * add TEMP_CURRENT_EXTERNAL for th sensor with external probe. fixes #136472 * ruff format * add translation_key temperature_external for TEMP_CURRENT_EXTERNAL --------- Co-authored-by: Franck Nijhof <git@frenck.dev>pull/137215/merge
parent
5b1f3d3e7f
commit
0694f9e164
|
@ -291,6 +291,9 @@ BINARY_SENSORS: dict[str, tuple[TuyaBinarySensorEntityDescription, ...]] = {
|
||||||
# Temperature and Humidity Sensor
|
# Temperature and Humidity Sensor
|
||||||
# https://developer.tuya.com/en/docs/iot/categorywsdcg?id=Kaiuz3hinij34
|
# https://developer.tuya.com/en/docs/iot/categorywsdcg?id=Kaiuz3hinij34
|
||||||
"wsdcg": (TAMPER_BINARY_SENSOR,),
|
"wsdcg": (TAMPER_BINARY_SENSOR,),
|
||||||
|
# Temperature and Humidity Sensor with External Probe
|
||||||
|
# New undocumented category qxj, see https://github.com/home-assistant/core/issues/136472
|
||||||
|
"qxj": (TAMPER_BINARY_SENSOR,),
|
||||||
# Pressure Sensor
|
# Pressure Sensor
|
||||||
# https://developer.tuya.com/en/docs/iot/categoryylcg?id=Kaiuz3kc2e4gm
|
# https://developer.tuya.com/en/docs/iot/categoryylcg?id=Kaiuz3kc2e4gm
|
||||||
"ylcg": (
|
"ylcg": (
|
||||||
|
|
|
@ -333,6 +333,12 @@ class DPCode(StrEnum):
|
||||||
TEMP_CONTROLLER = "temp_controller"
|
TEMP_CONTROLLER = "temp_controller"
|
||||||
TEMP_CURRENT = "temp_current" # Current temperature in °C
|
TEMP_CURRENT = "temp_current" # Current temperature in °C
|
||||||
TEMP_CURRENT_F = "temp_current_f" # Current temperature in °F
|
TEMP_CURRENT_F = "temp_current_f" # Current temperature in °F
|
||||||
|
TEMP_CURRENT_EXTERNAL = (
|
||||||
|
"temp_current_external" # Current external temperature in Celsius
|
||||||
|
)
|
||||||
|
TEMP_CURRENT_EXTERNAL_F = (
|
||||||
|
"temp_current_external_f" # Current external temperature in Fahrenheit
|
||||||
|
)
|
||||||
TEMP_INDOOR = "temp_indoor" # Indoor temperature in °C
|
TEMP_INDOOR = "temp_indoor" # Indoor temperature in °C
|
||||||
TEMP_SET = "temp_set" # Set the temperature in °C
|
TEMP_SET = "temp_set" # Set the temperature in °C
|
||||||
TEMP_SET_F = "temp_set_f" # Set the temperature in °F
|
TEMP_SET_F = "temp_set_f" # Set the temperature in °F
|
||||||
|
|
|
@ -715,6 +715,47 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
|
||||||
),
|
),
|
||||||
*BATTERY_SENSORS,
|
*BATTERY_SENSORS,
|
||||||
),
|
),
|
||||||
|
# Temperature and Humidity Sensor with External Probe
|
||||||
|
# New undocumented category qxj, see https://github.com/home-assistant/core/issues/136472
|
||||||
|
"qxj": (
|
||||||
|
TuyaSensorEntityDescription(
|
||||||
|
key=DPCode.VA_TEMPERATURE,
|
||||||
|
translation_key="temperature",
|
||||||
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
),
|
||||||
|
TuyaSensorEntityDescription(
|
||||||
|
key=DPCode.TEMP_CURRENT,
|
||||||
|
translation_key="temperature",
|
||||||
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
),
|
||||||
|
TuyaSensorEntityDescription(
|
||||||
|
key=DPCode.TEMP_CURRENT_EXTERNAL,
|
||||||
|
translation_key="temperature_external",
|
||||||
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
),
|
||||||
|
TuyaSensorEntityDescription(
|
||||||
|
key=DPCode.VA_HUMIDITY,
|
||||||
|
translation_key="humidity",
|
||||||
|
device_class=SensorDeviceClass.HUMIDITY,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
),
|
||||||
|
TuyaSensorEntityDescription(
|
||||||
|
key=DPCode.HUMIDITY_VALUE,
|
||||||
|
translation_key="humidity",
|
||||||
|
device_class=SensorDeviceClass.HUMIDITY,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
),
|
||||||
|
TuyaSensorEntityDescription(
|
||||||
|
key=DPCode.BRIGHT_VALUE,
|
||||||
|
translation_key="illuminance",
|
||||||
|
device_class=SensorDeviceClass.ILLUMINANCE,
|
||||||
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
|
),
|
||||||
|
*BATTERY_SENSORS,
|
||||||
|
),
|
||||||
# Pressure Sensor
|
# Pressure Sensor
|
||||||
# https://developer.tuya.com/en/docs/iot/categoryylcg?id=Kaiuz3kc2e4gm
|
# https://developer.tuya.com/en/docs/iot/categoryylcg?id=Kaiuz3kc2e4gm
|
||||||
"ylcg": (
|
"ylcg": (
|
||||||
|
|
|
@ -469,6 +469,9 @@
|
||||||
"temperature": {
|
"temperature": {
|
||||||
"name": "[%key:component::sensor::entity_component::temperature::name%]"
|
"name": "[%key:component::sensor::entity_component::temperature::name%]"
|
||||||
},
|
},
|
||||||
|
"temperature_external": {
|
||||||
|
"name": "Probe temperature"
|
||||||
|
},
|
||||||
"humidity": {
|
"humidity": {
|
||||||
"name": "[%key:component::sensor::entity_component::humidity::name%]"
|
"name": "[%key:component::sensor::entity_component::humidity::name%]"
|
||||||
},
|
},
|
||||||
|
|
|
@ -612,6 +612,15 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
|
||||||
device_class=SwitchDeviceClass.OUTLET,
|
device_class=SwitchDeviceClass.OUTLET,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
# SIREN: Siren (switch) with Temperature and Humidity Sensor with External Probe
|
||||||
|
# New undocumented category qxj, see https://github.com/home-assistant/core/issues/136472
|
||||||
|
"qxj": (
|
||||||
|
SwitchEntityDescription(
|
||||||
|
key=DPCode.SWITCH,
|
||||||
|
translation_key="switch",
|
||||||
|
device_class=SwitchDeviceClass.OUTLET,
|
||||||
|
),
|
||||||
|
),
|
||||||
# Ceiling Light
|
# Ceiling Light
|
||||||
# https://developer.tuya.com/en/docs/iot/ceiling-light?id=Kaiuz03xxfc4r
|
# https://developer.tuya.com/en/docs/iot/ceiling-light?id=Kaiuz03xxfc4r
|
||||||
"xdd": (
|
"xdd": (
|
||||||
|
|
Loading…
Reference in New Issue