mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Add initial support for tuya cwjwq (#148420)
This commit is contained in:
parent
fae6b375cd
commit
bafd342d5d
@ -406,6 +406,7 @@ class DPCode(StrEnum):
|
||||
WIRELESS_ELECTRICITY = "wireless_electricity"
|
||||
WORK_MODE = "work_mode" # Working mode
|
||||
WORK_POWER = "work_power"
|
||||
WORK_STATE_E = "work_state_e"
|
||||
|
||||
|
||||
@dataclass
|
||||
|
@ -55,6 +55,15 @@ SELECTS: dict[str, tuple[SelectEntityDescription, ...]] = {
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
),
|
||||
# Smart Odor Eliminator-Pro
|
||||
# Undocumented, see https://github.com/orgs/home-assistant/discussions/79
|
||||
"cwjwq": (
|
||||
SelectEntityDescription(
|
||||
key=DPCode.WORK_MODE,
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
translation_key="odor_elimination_mode",
|
||||
),
|
||||
),
|
||||
# Multi-functional Sensor
|
||||
# https://developer.tuya.com/en/docs/iot/categorydgnbj?id=Kaiuz3yorvzg3
|
||||
"dgnbj": (
|
||||
|
@ -220,6 +220,15 @@ SENSORS: dict[str, tuple[TuyaSensorEntityDescription, ...]] = {
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
),
|
||||
# Smart Odor Eliminator-Pro
|
||||
# Undocumented, see https://github.com/orgs/home-assistant/discussions/79
|
||||
"cwjwq": (
|
||||
TuyaSensorEntityDescription(
|
||||
key=DPCode.WORK_STATE_E,
|
||||
translation_key="odor_elimination_status",
|
||||
),
|
||||
*BATTERY_SENSORS,
|
||||
),
|
||||
# Smart Pet Feeder
|
||||
# https://developer.tuya.com/en/docs/iot/categorycwwsq?id=Kaiuz2b6vydld
|
||||
"cwwsq": (
|
||||
|
@ -485,6 +485,13 @@
|
||||
"level_9": "Level 9",
|
||||
"level_10": "High"
|
||||
}
|
||||
},
|
||||
"odor_elimination_mode": {
|
||||
"name": "Odor elimination mode",
|
||||
"state": {
|
||||
"smart": "Smart",
|
||||
"interim": "Interim"
|
||||
}
|
||||
}
|
||||
},
|
||||
"sensor": {
|
||||
@ -697,6 +704,15 @@
|
||||
},
|
||||
"water_time": {
|
||||
"name": "Water usage duration"
|
||||
},
|
||||
"odor_elimination_status": {
|
||||
"name": "Status",
|
||||
"state": {
|
||||
"work": "Working",
|
||||
"standby": "[%key:common::state::standby%]",
|
||||
"charging": "[%key:common::state::charging%]",
|
||||
"charge_done": "Charge done"
|
||||
}
|
||||
}
|
||||
},
|
||||
"switch": {
|
||||
|
@ -85,6 +85,14 @@ SWITCHES: dict[str, tuple[SwitchEntityDescription, ...]] = {
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
),
|
||||
),
|
||||
# Smart Odor Eliminator-Pro
|
||||
# Undocumented, see https://github.com/orgs/home-assistant/discussions/79
|
||||
"cwjwq": (
|
||||
SwitchEntityDescription(
|
||||
key=DPCode.SWITCH,
|
||||
translation_key="switch",
|
||||
),
|
||||
),
|
||||
# Smart Pet Feeder
|
||||
# https://developer.tuya.com/en/docs/iot/categorycwwsq?id=Kaiuz2b6vydld
|
||||
"cwwsq": (
|
||||
|
@ -45,6 +45,12 @@ DEVICE_MOCKS = {
|
||||
Platform.FAN,
|
||||
Platform.HUMIDIFIER,
|
||||
],
|
||||
"cwjwq_smart_odor_eliminator": [
|
||||
# https://github.com/orgs/home-assistant/discussions/79
|
||||
Platform.SELECT,
|
||||
Platform.SENSOR,
|
||||
Platform.SWITCH,
|
||||
],
|
||||
"cwwsq_cleverio_pf100": [
|
||||
# https://github.com/home-assistant/core/issues/144745
|
||||
Platform.NUMBER,
|
||||
|
@ -0,0 +1,66 @@
|
||||
{
|
||||
"endpoint": "https://apigw.tuyaeu.com",
|
||||
"terminal_id": "1750837476328i3TNXQ",
|
||||
"mqtt_connected": true,
|
||||
"disabled_by": null,
|
||||
"disabled_polling": false,
|
||||
"id": "bf6574iutyikgwkx",
|
||||
"name": "Smart Odor Eliminator-Pro",
|
||||
"category": "cwjwq",
|
||||
"product_id": "agwu93lr",
|
||||
"product_name": "Smart Odor Eliminator-Pro",
|
||||
"online": false,
|
||||
"sub": false,
|
||||
"time_zone": "+02:00",
|
||||
"active_time": "2025-06-25T07:43:07+00:00",
|
||||
"create_time": "2025-06-25T07:43:07+00:00",
|
||||
"update_time": "2025-06-25T07:43:07+00:00",
|
||||
"function": {
|
||||
"switch": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"work_mode": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["smart", "interim"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"status_range": {
|
||||
"switch": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"work_mode": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["smart", "interim"]
|
||||
}
|
||||
},
|
||||
"work_state_e": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["work", "standby", "charging", "charge_done"]
|
||||
}
|
||||
},
|
||||
"battery_percentage": {
|
||||
"type": "Integer",
|
||||
"value": {
|
||||
"unit": "%",
|
||||
"min": 0,
|
||||
"max": 100,
|
||||
"scale": 0,
|
||||
"step": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"switch": false,
|
||||
"work_mode": "smart",
|
||||
"work_state_e": "work",
|
||||
"battery_percentage": 43
|
||||
},
|
||||
"set_up": false,
|
||||
"support_local": true
|
||||
}
|
@ -178,6 +178,63 @@
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[cwjwq_smart_odor_eliminator][select.smart_odor_eliminator_pro_odor_elimination_mode-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'options': list([
|
||||
'smart',
|
||||
'interim',
|
||||
]),
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'select',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'select.smart_odor_eliminator_pro_odor_elimination_mode',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Odor elimination mode',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'odor_elimination_mode',
|
||||
'unique_id': 'tuya.bf6574iutyikgwkxwork_mode',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[cwjwq_smart_odor_eliminator][select.smart_odor_eliminator_pro_odor_elimination_mode-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Smart Odor Eliminator-Pro Odor elimination mode',
|
||||
'options': list([
|
||||
'smart',
|
||||
'interim',
|
||||
]),
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'select.smart_odor_eliminator_pro_odor_elimination_mode',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[kj_bladeless_tower_fan][select.bree_countdown-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
@ -105,6 +105,107 @@
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[cwjwq_smart_odor_eliminator][sensor.smart_odor_eliminator_pro_battery-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
|
||||
'entity_id': 'sensor.smart_odor_eliminator_pro_battery',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.BATTERY: 'battery'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Battery',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'battery',
|
||||
'unique_id': 'tuya.bf6574iutyikgwkxbattery_percentage',
|
||||
'unit_of_measurement': '%',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[cwjwq_smart_odor_eliminator][sensor.smart_odor_eliminator_pro_battery-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'battery',
|
||||
'friendly_name': 'Smart Odor Eliminator-Pro Battery',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': '%',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.smart_odor_eliminator_pro_battery',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[cwjwq_smart_odor_eliminator][sensor.smart_odor_eliminator_pro_status-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.smart_odor_eliminator_pro_status',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Status',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'odor_elimination_status',
|
||||
'unique_id': 'tuya.bf6574iutyikgwkxwork_state_e',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[cwjwq_smart_odor_eliminator][sensor.smart_odor_eliminator_pro_status-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Smart Odor Eliminator-Pro Status',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.smart_odor_eliminator_pro_status',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[cwwsq_cleverio_pf100][sensor.cleverio_pf100_last_amount-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
@ -146,6 +146,54 @@
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[cwjwq_smart_odor_eliminator][switch.smart_odor_eliminator_pro_switch-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'switch',
|
||||
'entity_category': None,
|
||||
'entity_id': 'switch.smart_odor_eliminator_pro_switch',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
}),
|
||||
'original_device_class': None,
|
||||
'original_icon': None,
|
||||
'original_name': 'Switch',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'switch',
|
||||
'unique_id': 'tuya.bf6574iutyikgwkxswitch',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[cwjwq_smart_odor_eliminator][switch.smart_odor_eliminator_pro_switch-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Smart Odor Eliminator-Pro Switch',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.smart_odor_eliminator_pro_switch',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unavailable',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[cwysj_pixi_smart_drinking_fountain][switch.pixi_smart_drinking_fountain_filter_reset-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
Loading…
x
Reference in New Issue
Block a user