Expose filter/pump timers for Tuya pet fountains (#131863)

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Dave Ingram 2025-05-26 20:01:45 +01:00 committed by GitHub
parent c36f8c38ae
commit d6375a79a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 48 additions and 2 deletions

View File

@ -199,7 +199,8 @@ class DPCode(StrEnum):
FEED_REPORT = "feed_report"
FEED_STATE = "feed_state"
FILTER = "filter"
FILTER_LIFE = "filter"
FILTER_DURATION = "filter_life" # Filter duration (hours)
FILTER_LIFE = "filter" # Filter life (percentage)
FILTER_RESET = "filter_reset" # Filter (cartridge) reset
FLOODLIGHT_LIGHTNESS = "floodlight_lightness"
FLOODLIGHT_SWITCH = "floodlight_switch"
@ -267,6 +268,7 @@ class DPCode(StrEnum):
PRESSURE_VALUE = "pressure_value"
PUMP = "pump"
PUMP_RESET = "pump_reset" # Water pump reset
PUMP_TIME = "pump_time" # Water pump duration
OXYGEN = "oxygen" # Oxygen bar
RECORD_MODE = "record_mode"
RECORD_SWITCH = "record_switch" # Recording switch
@ -374,6 +376,7 @@ class DPCode(StrEnum):
UPPER_TEMP = "upper_temp"
UPPER_TEMP_F = "upper_temp_f"
UV = "uv" # UV sterilization
UV_RUNTIME = "uv_runtime" # UV runtime
VA_BATTERY = "va_battery"
VA_HUMIDITY = "va_humidity"
VA_TEMPERATURE = "va_temperature"
@ -387,6 +390,7 @@ class DPCode(StrEnum):
WATER = "water"
WATER_RESET = "water_reset" # Resetting of water usage days
WATER_SET = "water_set" # Water level
WATER_TIME = "water_time" # Water usage duration
WATERSENSOR_STATE = "watersensor_state"
WEATHER_DELAY = "weather_delay"
WET = "wet" # Humidification

View File

@ -305,6 +305,36 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
state_class=SensorStateClass.MEASUREMENT,
),
),
# Pet Fountain
# https://developer.tuya.com/en/docs/iot/s?id=K9gf48r0as4ln
"cwysj": (
TuyaSensorEntityDescription(
key=DPCode.UV_RUNTIME,
translation_key="uv_runtime",
device_class=SensorDeviceClass.DURATION,
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
),
TuyaSensorEntityDescription(
key=DPCode.PUMP_TIME,
translation_key="pump_time",
device_class=SensorDeviceClass.DURATION,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.FILTER_DURATION,
translation_key="filter_duration",
device_class=SensorDeviceClass.DURATION,
state_class=SensorStateClass.MEASUREMENT,
),
TuyaSensorEntityDescription(
key=DPCode.WATER_TIME,
translation_key="water_time",
device_class=SensorDeviceClass.DURATION,
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
),
),
# Air Quality Monitor
# https://developer.tuya.com/en/docs/iot/hjjcy?id=Kbeoad8y1nnlv
"hjjcy": (

View File

@ -668,6 +668,18 @@
"level_5": "Level 5",
"level_6": "Level 6"
}
},
"uv_runtime": {
"name": "UV runtime"
},
"pump_time": {
"name": "Water pump duration"
},
"filter_duration": {
"name": "Filter duration"
},
"water_time": {
"name": "Water usage duration"
}
},
"switch": {

View File

@ -80,7 +80,7 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
entity_category=EntityCategory.CONFIG,
),
),
# Pet Water Feeder
# Pet Fountain
# https://developer.tuya.com/en/docs/iot/f?id=K9gf46aewxem5
"cwysj": (
SwitchEntityDescription(