Skip to content

Commit d2ad5b4

Browse files
Added switches to cat litter box (home-assistant#156055)
1 parent 4fae491 commit d2ad5b4

File tree

4 files changed

+107
-0
lines changed

4 files changed

+107
-0
lines changed

homeassistant/components/tuya/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ class DPCode(StrEnum):
616616
ARM_DOWN_PERCENT = "arm_down_percent"
617617
ARM_UP_PERCENT = "arm_up_percent"
618618
ATMOSPHERIC_PRESSTURE = "atmospheric_pressture" # Typo is in Tuya API
619+
AUTO_CLEAN = "auto_clean"
619620
BACKUP_RESERVE = "backup_reserve"
620621
BASIC_ANTI_FLICKER = "basic_anti_flicker"
621622
BASIC_DEVICE_VOLUME = "basic_device_volume"

homeassistant/components/tuya/strings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,9 @@
886886
"arm_beep": {
887887
"name": "Arm beep"
888888
},
889+
"auto_clean": {
890+
"name": "Auto clean"
891+
},
889892
"battery_lock": {
890893
"name": "Battery lock"
891894
},

homeassistant/components/tuya/switch.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,13 @@ class TuyaDeprecatedSwitchEntityDescription(SwitchEntityDescription):
523523
entity_category=EntityCategory.CONFIG,
524524
),
525525
),
526+
DeviceCategory.MSP: (
527+
SwitchEntityDescription(
528+
key=DPCode.AUTO_CLEAN,
529+
translation_key="auto_clean",
530+
entity_category=EntityCategory.CONFIG,
531+
),
532+
),
526533
DeviceCategory.MZJ: (
527534
SwitchEntityDescription(
528535
key=DPCode.SWITCH,

tests/components/tuya/snapshots/test_switch.ambr

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5704,6 +5704,54 @@
57045704
'state': 'off',
57055705
})
57065706
# ---
5707+
# name: test_platform_setup_and_discovery[switch.kattenbak_auto_clean-entry]
5708+
EntityRegistryEntrySnapshot({
5709+
'aliases': set({
5710+
}),
5711+
'area_id': None,
5712+
'capabilities': None,
5713+
'config_entry_id': <ANY>,
5714+
'config_subentry_id': <ANY>,
5715+
'device_class': None,
5716+
'device_id': <ANY>,
5717+
'disabled_by': None,
5718+
'domain': 'switch',
5719+
'entity_category': <EntityCategory.CONFIG: 'config'>,
5720+
'entity_id': 'switch.kattenbak_auto_clean',
5721+
'has_entity_name': True,
5722+
'hidden_by': None,
5723+
'icon': None,
5724+
'id': <ANY>,
5725+
'labels': set({
5726+
}),
5727+
'name': None,
5728+
'options': dict({
5729+
}),
5730+
'original_device_class': None,
5731+
'original_icon': None,
5732+
'original_name': 'Auto clean',
5733+
'platform': 'tuya',
5734+
'previous_unique_id': None,
5735+
'suggested_object_id': None,
5736+
'supported_features': 0,
5737+
'translation_key': 'auto_clean',
5738+
'unique_id': 'tuya.yohkwjjdjlzludd3psmauto_clean',
5739+
'unit_of_measurement': None,
5740+
})
5741+
# ---
5742+
# name: test_platform_setup_and_discovery[switch.kattenbak_auto_clean-state]
5743+
StateSnapshot({
5744+
'attributes': ReadOnlyDict({
5745+
'friendly_name': 'Kattenbak Auto clean',
5746+
}),
5747+
'context': <ANY>,
5748+
'entity_id': 'switch.kattenbak_auto_clean',
5749+
'last_changed': <ANY>,
5750+
'last_reported': <ANY>,
5751+
'last_updated': <ANY>,
5752+
'state': 'on',
5753+
})
5754+
# ---
57075755
# name: test_platform_setup_and_discovery[switch.keller_socket_1-entry]
57085756
EntityRegistryEntrySnapshot({
57095757
'aliases': set({
@@ -7205,6 +7253,54 @@
72057253
'state': 'off',
72067254
})
72077255
# ---
7256+
# name: test_platform_setup_and_discovery[switch.poopy_nano_2_auto_clean-entry]
7257+
EntityRegistryEntrySnapshot({
7258+
'aliases': set({
7259+
}),
7260+
'area_id': None,
7261+
'capabilities': None,
7262+
'config_entry_id': <ANY>,
7263+
'config_subentry_id': <ANY>,
7264+
'device_class': None,
7265+
'device_id': <ANY>,
7266+
'disabled_by': None,
7267+
'domain': 'switch',
7268+
'entity_category': <EntityCategory.CONFIG: 'config'>,
7269+
'entity_id': 'switch.poopy_nano_2_auto_clean',
7270+
'has_entity_name': True,
7271+
'hidden_by': None,
7272+
'icon': None,
7273+
'id': <ANY>,
7274+
'labels': set({
7275+
}),
7276+
'name': None,
7277+
'options': dict({
7278+
}),
7279+
'original_device_class': None,
7280+
'original_icon': None,
7281+
'original_name': 'Auto clean',
7282+
'platform': 'tuya',
7283+
'previous_unique_id': None,
7284+
'suggested_object_id': None,
7285+
'supported_features': 0,
7286+
'translation_key': 'auto_clean',
7287+
'unique_id': 'tuya.nyriu7sjgj9oruzmpsmauto_clean',
7288+
'unit_of_measurement': None,
7289+
})
7290+
# ---
7291+
# name: test_platform_setup_and_discovery[switch.poopy_nano_2_auto_clean-state]
7292+
StateSnapshot({
7293+
'attributes': ReadOnlyDict({
7294+
'friendly_name': 'Poopy Nano 2 Auto clean',
7295+
}),
7296+
'context': <ANY>,
7297+
'entity_id': 'switch.poopy_nano_2_auto_clean',
7298+
'last_changed': <ANY>,
7299+
'last_reported': <ANY>,
7300+
'last_updated': <ANY>,
7301+
'state': 'off',
7302+
})
7303+
# ---
72087304
# name: test_platform_setup_and_discovery[switch.powerplug_5_socket_1-entry]
72097305
EntityRegistryEntrySnapshot({
72107306
'aliases': set({

0 commit comments

Comments
 (0)