mirror of
https://github.com/home-assistant/core.git
synced 2026-09-05 02:25:07 -05:00
Adding new sensors to the cat litter box (#156054)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
This commit is contained in:
co-authored by
Copilot
epenet
parent
938da38fc3
commit
f2ef0503a0
@@ -851,11 +851,16 @@ SENSORS: dict[DeviceCategory, tuple[TuyaSensorEntityDescription, ...]] = {
|
||||
key=DPCode.EXCRETION_TIME_DAY,
|
||||
translation_key="excretion_time_day",
|
||||
device_class=SensorDeviceClass.DURATION,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
TuyaSensorEntityDescription(
|
||||
key=DPCode.EXCRETION_TIMES_DAY,
|
||||
translation_key="excretion_times_day",
|
||||
),
|
||||
TuyaSensorEntityDescription(
|
||||
key=DPCode.STATUS,
|
||||
translation_key="cat_litter_box_status",
|
||||
),
|
||||
),
|
||||
DeviceCategory.MZJ: (
|
||||
TuyaSensorEntityDescription(
|
||||
|
||||
@@ -617,6 +617,17 @@
|
||||
"carbon_monoxide": {
|
||||
"name": "[%key:component::sensor::entity_component::carbon_monoxide::name%]"
|
||||
},
|
||||
"cat_litter_box_status": {
|
||||
"name": "[%key:component::tuya::entity::sensor::status::name%]",
|
||||
"state": {
|
||||
"clean": "Cleaning",
|
||||
"empty": "Emptying",
|
||||
"level": "Leveling",
|
||||
"sleep": "Sleeping",
|
||||
"standby": "[%key:common::state::standby%]",
|
||||
"uv": "Sanitizing"
|
||||
}
|
||||
},
|
||||
"cat_weight": {
|
||||
"name": "Cat weight"
|
||||
},
|
||||
@@ -645,7 +656,7 @@
|
||||
"name": "Duster cloth lifetime"
|
||||
},
|
||||
"excretion_time_day": {
|
||||
"name": "Excretion time (day)"
|
||||
"name": "Excretion duration"
|
||||
},
|
||||
"excretion_times_day": {
|
||||
"name": "Excretion times (day)"
|
||||
|
||||
@@ -10376,12 +10376,14 @@
|
||||
'state': '0.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sensor.kattenbak_excretion_time_day-entry]
|
||||
# name: test_platform_setup_and_discovery[sensor.kattenbak_excretion_duration-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'capabilities': dict({
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
@@ -10389,7 +10391,7 @@
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.kattenbak_excretion_time_day',
|
||||
'entity_id': 'sensor.kattenbak_excretion_duration',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
@@ -10404,7 +10406,7 @@
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.DURATION: 'duration'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Excretion time (day)',
|
||||
'original_name': 'Excretion duration',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
@@ -10414,15 +10416,16 @@
|
||||
'unit_of_measurement': 's',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sensor.kattenbak_excretion_time_day-state]
|
||||
# name: test_platform_setup_and_discovery[sensor.kattenbak_excretion_duration-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'duration',
|
||||
'friendly_name': 'Kattenbak Excretion time (day)',
|
||||
'friendly_name': 'Kattenbak Excretion duration',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': 's',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.kattenbak_excretion_time_day',
|
||||
'entity_id': 'sensor.kattenbak_excretion_duration',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
@@ -10478,6 +10481,54 @@
|
||||
'state': '1.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sensor.kattenbak_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.kattenbak_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': 'cat_litter_box_status',
|
||||
'unique_id': 'tuya.yohkwjjdjlzludd3psmstatus',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sensor.kattenbak_status-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Kattenbak Status',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.kattenbak_status',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'standby',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sensor.keller_current-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
@@ -15243,12 +15294,14 @@
|
||||
'state': '3.6',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sensor.poopy_nano_2_excretion_time_day-entry]
|
||||
# name: test_platform_setup_and_discovery[sensor.poopy_nano_2_excretion_duration-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': None,
|
||||
'capabilities': dict({
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
@@ -15256,7 +15309,7 @@
|
||||
'disabled_by': None,
|
||||
'domain': 'sensor',
|
||||
'entity_category': None,
|
||||
'entity_id': 'sensor.poopy_nano_2_excretion_time_day',
|
||||
'entity_id': 'sensor.poopy_nano_2_excretion_duration',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
@@ -15271,7 +15324,7 @@
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.DURATION: 'duration'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Excretion time (day)',
|
||||
'original_name': 'Excretion duration',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
@@ -15281,15 +15334,16 @@
|
||||
'unit_of_measurement': 's',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sensor.poopy_nano_2_excretion_time_day-state]
|
||||
# name: test_platform_setup_and_discovery[sensor.poopy_nano_2_excretion_duration-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'duration',
|
||||
'friendly_name': 'Poopy Nano 2 Excretion time (day)',
|
||||
'friendly_name': 'Poopy Nano 2 Excretion duration',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': 's',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.poopy_nano_2_excretion_time_day',
|
||||
'entity_id': 'sensor.poopy_nano_2_excretion_duration',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
@@ -15345,6 +15399,54 @@
|
||||
'state': '4.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sensor.poopy_nano_2_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.poopy_nano_2_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': 'cat_litter_box_status',
|
||||
'unique_id': 'tuya.nyriu7sjgj9oruzmpsmstatus',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sensor.poopy_nano_2_status-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Poopy Nano 2 Status',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.poopy_nano_2_status',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unknown',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sensor.production_total_energy-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
||||
Reference in New Issue
Block a user