Add Tuya snapshots for hps category (#149936)

This commit is contained in:
epenet
2025-08-04 11:14:11 +02:00
committed by GitHub
parent aa8e4c1c15
commit e62e3778f3
4 changed files with 416 additions and 0 deletions

View File

@@ -92,6 +92,11 @@ DEVICE_MOCKS = {
# https://github.com/home-assistant/core/issues/133173
Platform.LIGHT,
],
"hps_2aaelwxk": [
# https://github.com/home-assistant/core/issues/149704
Platform.BINARY_SENSOR,
Platform.NUMBER,
],
"kg_gbm9ata1zrzaez4a": [
# https://github.com/home-assistant/core/issues/148347
Platform.SWITCH,

View File

@@ -0,0 +1,186 @@
{
"endpoint": "https://apigw.tuyaeu.com",
"terminal_id": "REDACTED",
"mqtt_connected": true,
"disabled_by": null,
"disabled_polling": false,
"id": "bf78687ad321a3aeb8a73m",
"name": "Human presence Office",
"category": "hps",
"product_id": "2aaelwxk",
"product_name": "Human presence sensor",
"online": true,
"sub": true,
"time_zone": "+01:00",
"active_time": "2023-12-31T14:40:17+00:00",
"create_time": "2023-12-31T14:40:17+00:00",
"update_time": "2023-12-31T14:40:17+00:00",
"function": {
"sensitivity": {
"type": "Integer",
"value": {
"unit": "x",
"min": 0,
"max": 10,
"scale": 0,
"step": 1
}
},
"near_detection": {
"type": "Integer",
"value": {
"unit": "cm",
"min": 0,
"max": 1000,
"scale": 0,
"step": 1
}
},
"far_detection": {
"type": "Integer",
"value": {
"unit": "cm",
"min": 0,
"max": 1000,
"scale": 0,
"step": 1
}
},
"presence_time": {
"type": "Integer",
"value": {
"unit": "s",
"min": 0,
"max": 28800,
"scale": 0,
"step": 1
}
},
"motionless_far_detection": {
"type": "Integer",
"value": {
"unit": "cm",
"min": 0,
"max": 600,
"scale": 0,
"step": 1
}
},
"motionless_sensitivity": {
"type": "Integer",
"value": {
"unit": "x",
"min": 0,
"max": 10,
"scale": 0,
"step": 1
}
},
"indicator": {
"type": "Boolean",
"value": {}
}
},
"status_range": {
"presence_state": {
"type": "Enum",
"value": {
"range": ["none", "presence"]
}
},
"sensitivity": {
"type": "Integer",
"value": {
"unit": "x",
"min": 0,
"max": 10,
"scale": 0,
"step": 1
}
},
"near_detection": {
"type": "Integer",
"value": {
"unit": "cm",
"min": 0,
"max": 1000,
"scale": 0,
"step": 1
}
},
"far_detection": {
"type": "Integer",
"value": {
"unit": "cm",
"min": 0,
"max": 1000,
"scale": 0,
"step": 1
}
},
"human_motion_state": {
"type": "Enum",
"value": {
"range": ["none", "large_move", "small_move"]
}
},
"presence_time": {
"type": "Integer",
"value": {
"unit": "s",
"min": 0,
"max": 28800,
"scale": 0,
"step": 1
}
},
"motionless_far_detection": {
"type": "Integer",
"value": {
"unit": "cm",
"min": 0,
"max": 600,
"scale": 0,
"step": 1
}
},
"motionless_sensitivity": {
"type": "Integer",
"value": {
"unit": "x",
"min": 0,
"max": 10,
"scale": 0,
"step": 1
}
},
"illuminance_value": {
"type": "Integer",
"value": {
"unit": "lux",
"min": 0,
"max": 6000,
"scale": 0,
"step": 1
}
},
"indicator": {
"type": "Boolean",
"value": {}
}
},
"status": {
"presence_state": "none",
"sensitivity": 3,
"near_detection": 40,
"far_detection": 220,
"human_motion_state": "none",
"presence_time": 30,
"motionless_far_detection": 30,
"motionless_sensitivity": 7,
"illuminance_value": 0,
"indicator": true
},
"set_up": true,
"support_local": true
}

View File

@@ -293,6 +293,55 @@
'state': 'off',
})
# ---
# name: test_platform_setup_and_discovery[hps_2aaelwxk][binary_sensor.human_presence_office_occupancy-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': None,
'entity_id': 'binary_sensor.human_presence_office_occupancy',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.OCCUPANCY: 'occupancy'>,
'original_icon': None,
'original_name': 'Occupancy',
'platform': 'tuya',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'tuya.bf78687ad321a3aeb8a73mpresence_state',
'unit_of_measurement': None,
})
# ---
# name: test_platform_setup_and_discovery[hps_2aaelwxk][binary_sensor.human_presence_office_occupancy-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'occupancy',
'friendly_name': 'Human presence Office Occupancy',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.human_presence_office_occupancy',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_platform_setup_and_discovery[mcs_7jIGJAymiH8OsFFb][binary_sensor.door_garage_door-entry]
EntityRegistryEntrySnapshot({
'aliases': set({

View File

@@ -116,6 +116,182 @@
'state': '1.0',
})
# ---
# name: test_platform_setup_and_discovery[hps_2aaelwxk][number.human_presence_office_far_detection-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 1000.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.human_presence_office_far_detection',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <NumberDeviceClass.DISTANCE: 'distance'>,
'original_icon': None,
'original_name': 'Far detection',
'platform': 'tuya',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'far_detection',
'unique_id': 'tuya.bf78687ad321a3aeb8a73mfar_detection',
'unit_of_measurement': 'cm',
})
# ---
# name: test_platform_setup_and_discovery[hps_2aaelwxk][number.human_presence_office_far_detection-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'distance',
'friendly_name': 'Human presence Office Far detection',
'max': 1000.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
'unit_of_measurement': 'cm',
}),
'context': <ANY>,
'entity_id': 'number.human_presence_office_far_detection',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '220.0',
})
# ---
# name: test_platform_setup_and_discovery[hps_2aaelwxk][number.human_presence_office_near_detection-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 1000.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.human_presence_office_near_detection',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <NumberDeviceClass.DISTANCE: 'distance'>,
'original_icon': None,
'original_name': 'Near detection',
'platform': 'tuya',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'near_detection',
'unique_id': 'tuya.bf78687ad321a3aeb8a73mnear_detection',
'unit_of_measurement': 'cm',
})
# ---
# name: test_platform_setup_and_discovery[hps_2aaelwxk][number.human_presence_office_near_detection-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'distance',
'friendly_name': 'Human presence Office Near detection',
'max': 1000.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
'unit_of_measurement': 'cm',
}),
'context': <ANY>,
'entity_id': 'number.human_presence_office_near_detection',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '40.0',
})
# ---
# name: test_platform_setup_and_discovery[hps_2aaelwxk][number.human_presence_office_sensitivity-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 10.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.human_presence_office_sensitivity',
'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': 'Sensitivity',
'platform': 'tuya',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'sensitivity',
'unique_id': 'tuya.bf78687ad321a3aeb8a73msensitivity',
'unit_of_measurement': 'x',
})
# ---
# name: test_platform_setup_and_discovery[hps_2aaelwxk][number.human_presence_office_sensitivity-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Human presence Office Sensitivity',
'max': 10.0,
'min': 0.0,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 1.0,
'unit_of_measurement': 'x',
}),
'context': <ANY>,
'entity_id': 'number.human_presence_office_sensitivity',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '3.0',
})
# ---
# name: test_platform_setup_and_discovery[mal_gyitctrjj1kefxp2][number.multifunction_alarm_alarm_delay-entry]
EntityRegistryEntrySnapshot({
'aliases': set({