1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-08 17:49:37 +01:00

Add Tuya pet feeder entities (#161440)

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
This commit is contained in:
Fredrik Mårtensson
2026-01-23 11:38:32 +01:00
committed by GitHub
parent f1bf2625e6
commit 9046ae1602
6 changed files with 233 additions and 0 deletions
@@ -107,6 +107,11 @@ BINARY_SENSORS: dict[DeviceCategory, tuple[TuyaBinarySensorEntityDescription, ..
translation_key="feeding",
on_value="feeding",
),
TuyaBinarySensorEntityDescription(
key=DPCode.CHARGE_STATE,
device_class=BinarySensorDeviceClass.BATTERY_CHARGING,
entity_category=EntityCategory.DIAGNOSTIC,
),
),
DeviceCategory.DGNBJ: (
TuyaBinarySensorEntityDescription(
+7
View File
@@ -242,6 +242,13 @@ LIGHTS: dict[DeviceCategory, tuple[TuyaLightEntityDescription, ...]] = {
entity_category=EntityCategory.CONFIG,
),
),
DeviceCategory.CWWSQ: (
TuyaLightEntityDescription(
key=DPCode.LIGHT,
translation_key="light",
entity_category=EntityCategory.CONFIG,
),
),
DeviceCategory.DC: (
TuyaLightEntityDescription(
key=DPCode.SWITCH_LED,
+1
View File
@@ -351,6 +351,7 @@ SENSORS: dict[DeviceCategory, tuple[TuyaSensorEntityDescription, ...]] = {
*BATTERY_SENSORS,
),
DeviceCategory.CWWSQ: (
*BATTERY_SENSORS,
TuyaSensorEntityDescription(
key=DPCode.FEED_REPORT,
translation_key="last_amount",
@@ -148,6 +148,56 @@
'state': 'off',
})
# ---
# name: test_platform_setup_and_discovery[binary_sensor.cleverio_pf100_charging-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': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.cleverio_pf100_charging',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Charging',
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.BATTERY_CHARGING: 'battery_charging'>,
'original_icon': None,
'original_name': 'Charging',
'platform': 'tuya',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'tuya.iomszlsve0yyzkfwqswwccharge_state',
'unit_of_measurement': None,
})
# ---
# name: test_platform_setup_and_discovery[binary_sensor.cleverio_pf100_charging-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'battery_charging',
'friendly_name': 'Cleverio PF100 Charging',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.cleverio_pf100_charging',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_platform_setup_and_discovery[binary_sensor.dehumidifer_defrost-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
@@ -528,6 +528,64 @@
'state': 'off',
})
# ---
# name: test_platform_setup_and_discovery[light.cat_feeder_light-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'supported_color_modes': list([
<ColorMode.ONOFF: 'onoff'>,
]),
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'light',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'light.cat_feeder_light',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Light',
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Light',
'platform': 'tuya',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'light',
'unique_id': 'tuya.igkrtodqg14xvfxlqswwclight',
'unit_of_measurement': None,
})
# ---
# name: test_platform_setup_and_discovery[light.cat_feeder_light-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'color_mode': <ColorMode.ONOFF: 'onoff'>,
'friendly_name': 'Cat Feeder Light',
'supported_color_modes': list([
<ColorMode.ONOFF: 'onoff'>,
]),
'supported_features': <LightEntityFeature: 0>,
}),
'context': <ANY>,
'entity_id': 'light.cat_feeder_light',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_platform_setup_and_discovery[light.ceiling_fan_light_v2-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
@@ -766,6 +824,64 @@
'state': 'off',
})
# ---
# name: test_platform_setup_and_discovery[light.cleverio_pf100_light-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'supported_color_modes': list([
<ColorMode.ONOFF: 'onoff'>,
]),
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'light',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'light.cleverio_pf100_light',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Light',
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Light',
'platform': 'tuya',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'light',
'unique_id': 'tuya.iomszlsve0yyzkfwqswwclight',
'unit_of_measurement': None,
})
# ---
# name: test_platform_setup_and_discovery[light.cleverio_pf100_light-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'color_mode': <ColorMode.ONOFF: 'onoff'>,
'friendly_name': 'Cleverio PF100 Light',
'supported_color_modes': list([
<ColorMode.ONOFF: 'onoff'>,
]),
'supported_features': <LightEntityFeature: 0>,
}),
'context': <ANY>,
'entity_id': 'light.cleverio_pf100_light',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_platform_setup_and_discovery[light.colorful_pir_night_light-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
@@ -4606,6 +4606,60 @@
'state': '0.0',
})
# ---
# name: test_platform_setup_and_discovery[sensor.cleverio_pf100_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.cleverio_pf100_battery',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Battery',
'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.iomszlsve0yyzkfwqswwcbattery_percentage',
'unit_of_measurement': '%',
})
# ---
# name: test_platform_setup_and_discovery[sensor.cleverio_pf100_battery-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'battery',
'friendly_name': 'Cleverio PF100 Battery',
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'sensor.cleverio_pf100_battery',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '90.0',
})
# ---
# name: test_platform_setup_and_discovery[sensor.cleverio_pf100_last_amount-entry]
EntityRegistryEntrySnapshot({
'aliases': set({