mirror of
https://github.com/Electric-Special/ha-core.git
synced 2026-03-21 08:06:00 +01:00
Add fixture for Poopy Nano 2 device in Tuya tests (#156048)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
This commit is contained in:
@@ -173,6 +173,7 @@ DEVICE_MOCKS = [
|
||||
"mcs_oxslv1c9", # https://github.com/home-assistant/core/issues/139966
|
||||
"mcs_qxu3flpqjsc1kqu3", # https://github.com/home-assistant/core/issues/141278
|
||||
"msp_3ddulzljdjjwkhoy", # https://github.com/orgs/home-assistant/discussions/262
|
||||
"msp_mzuro9jgjs7uiryn", # https://github.com/home-assistant/core/pull/156048
|
||||
"mzj_jlapoy5liocmtdvd", # https://github.com/home-assistant/core/issues/150662
|
||||
"mzj_qavcakohisj5adyh", # https://github.com/home-assistant/core/issues/141278
|
||||
"ntq_9mqdhwklpvnnvb7t", # https://github.com/orgs/home-assistant/discussions/517
|
||||
|
||||
155
tests/components/tuya/fixtures/msp_mzuro9jgjs7uiryn.json
Normal file
155
tests/components/tuya/fixtures/msp_mzuro9jgjs7uiryn.json
Normal file
@@ -0,0 +1,155 @@
|
||||
{
|
||||
"endpoint": "https://apigw.tuyaeu.com",
|
||||
"mqtt_connected": true,
|
||||
"disabled_by": null,
|
||||
"disabled_polling": false,
|
||||
"name": "Poopy Nano 2",
|
||||
"category": "msp",
|
||||
"product_id": "mzuro9jgjs7uiryn",
|
||||
"product_name": "Poopy Nano 2",
|
||||
"online": true,
|
||||
"sub": false,
|
||||
"time_zone": "+02:00",
|
||||
"active_time": "2025-07-08T18:02:16+00:00",
|
||||
"create_time": "2025-07-08T18:02:16+00:00",
|
||||
"update_time": "2025-07-08T18:02:16+00:00",
|
||||
"function": {
|
||||
"switch": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"start": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"auto_clean": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"delay_clean_time": {
|
||||
"type": "Integer",
|
||||
"value": {
|
||||
"unit": "s",
|
||||
"min": 1,
|
||||
"max": 600,
|
||||
"scale": 0,
|
||||
"step": 1
|
||||
}
|
||||
},
|
||||
"manual_clean": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"factory_reset": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"status": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["sleep"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"status_range": {
|
||||
"switch": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"start": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"auto_clean": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"delay_clean_time": {
|
||||
"type": "Integer",
|
||||
"value": {
|
||||
"unit": "s",
|
||||
"min": 1,
|
||||
"max": 600,
|
||||
"scale": 0,
|
||||
"step": 1
|
||||
}
|
||||
},
|
||||
"cat_weight": {
|
||||
"type": "Integer",
|
||||
"value": {
|
||||
"unit": "kg",
|
||||
"min": 6,
|
||||
"max": 100,
|
||||
"scale": 1,
|
||||
"step": 1
|
||||
}
|
||||
},
|
||||
"excretion_times_day": {
|
||||
"type": "Integer",
|
||||
"value": {
|
||||
"unit": "times",
|
||||
"min": 0,
|
||||
"max": 999999999,
|
||||
"scale": 0,
|
||||
"step": 1
|
||||
}
|
||||
},
|
||||
"excretion_time_day": {
|
||||
"type": "Integer",
|
||||
"value": {
|
||||
"unit": "s",
|
||||
"min": 0,
|
||||
"max": 1800,
|
||||
"scale": 0,
|
||||
"step": 1
|
||||
}
|
||||
},
|
||||
"manual_clean": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"notification": {
|
||||
"type": "Bitmap",
|
||||
"value": {
|
||||
"label": [
|
||||
"garbage_box_full",
|
||||
"excessive_clean_times",
|
||||
"cleaning",
|
||||
"no_weight"
|
||||
]
|
||||
}
|
||||
},
|
||||
"fault": {
|
||||
"type": "Bitmap",
|
||||
"value": {
|
||||
"label": ["E01", "E02", "E03", "00"]
|
||||
}
|
||||
},
|
||||
"factory_reset": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"status": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["sleep"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"switch": true,
|
||||
"start": false,
|
||||
"auto_clean": false,
|
||||
"delay_clean_time": 1,
|
||||
"cat_weight": 36,
|
||||
"excretion_times_day": 4,
|
||||
"excretion_time_day": 85,
|
||||
"manual_clean": false,
|
||||
"notification": 0,
|
||||
"fault": 0,
|
||||
"factory_reset": false,
|
||||
"status": "standly"
|
||||
},
|
||||
"set_up": true,
|
||||
"support_local": true
|
||||
}
|
||||
@@ -5393,6 +5393,37 @@
|
||||
'via_device_id': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_device_registry[nyriu7sjgj9oruzmpsm]
|
||||
DeviceRegistryEntrySnapshot({
|
||||
'area_id': None,
|
||||
'config_entries': <ANY>,
|
||||
'config_entries_subentries': <ANY>,
|
||||
'configuration_url': None,
|
||||
'connections': set({
|
||||
}),
|
||||
'disabled_by': None,
|
||||
'entry_type': None,
|
||||
'hw_version': None,
|
||||
'id': <ANY>,
|
||||
'identifiers': set({
|
||||
tuple(
|
||||
'tuya',
|
||||
'nyriu7sjgj9oruzmpsm',
|
||||
),
|
||||
}),
|
||||
'labels': set({
|
||||
}),
|
||||
'manufacturer': 'Tuya',
|
||||
'model': 'Poopy Nano 2',
|
||||
'model_id': 'mzuro9jgjs7uiryn',
|
||||
'name': 'Poopy Nano 2',
|
||||
'name_by_user': None,
|
||||
'primary_config_entry': <ANY>,
|
||||
'serial_number': None,
|
||||
'sw_version': None,
|
||||
'via_device_id': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_device_registry[o5kqedcacfng0plpnocfw]
|
||||
DeviceRegistryEntrySnapshot({
|
||||
'area_id': None,
|
||||
|
||||
@@ -14882,6 +14882,164 @@
|
||||
'state': '0.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sensor.poopy_nano_2_cat_weight-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': None,
|
||||
'entity_id': 'sensor.poopy_nano_2_cat_weight',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
'sensor': dict({
|
||||
'suggested_display_precision': 2,
|
||||
}),
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.WEIGHT: 'weight'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Cat weight',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'cat_weight',
|
||||
'unique_id': 'tuya.nyriu7sjgj9oruzmpsmcat_weight',
|
||||
'unit_of_measurement': 'kg',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sensor.poopy_nano_2_cat_weight-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'weight',
|
||||
'friendly_name': 'Poopy Nano 2 Cat weight',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': 'kg',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.poopy_nano_2_cat_weight',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '3.6',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sensor.poopy_nano_2_excretion_time_day-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_excretion_time_day',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'options': dict({
|
||||
'sensor': dict({
|
||||
'suggested_display_precision': 2,
|
||||
}),
|
||||
}),
|
||||
'original_device_class': <SensorDeviceClass.DURATION: 'duration'>,
|
||||
'original_icon': None,
|
||||
'original_name': 'Excretion time (day)',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'excretion_time_day',
|
||||
'unique_id': 'tuya.nyriu7sjgj9oruzmpsmexcretion_time_day',
|
||||
'unit_of_measurement': 's',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sensor.poopy_nano_2_excretion_time_day-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'duration',
|
||||
'friendly_name': 'Poopy Nano 2 Excretion time (day)',
|
||||
'unit_of_measurement': 's',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.poopy_nano_2_excretion_time_day',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '85.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sensor.poopy_nano_2_excretion_times_day-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_excretion_times_day',
|
||||
'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': 'Excretion times (day)',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'excretion_times_day',
|
||||
'unique_id': 'tuya.nyriu7sjgj9oruzmpsmexcretion_times_day',
|
||||
'unit_of_measurement': 'times',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sensor.poopy_nano_2_excretion_times_day-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'Poopy Nano 2 Excretion times (day)',
|
||||
'unit_of_measurement': 'times',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.poopy_nano_2_excretion_times_day',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '4.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sensor.production_total_energy-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
||||
Reference in New Issue
Block a user