mirror of
https://github.com/home-assistant/core.git
synced 2025-08-06 22:25:13 +02:00
Add Tuya snapshots tests for camera platform (#149959)
This commit is contained in:
@@ -306,16 +306,27 @@ DEVICE_MOCKS = {
|
||||
],
|
||||
"sp_drezasavompxpcgm": [
|
||||
# https://github.com/home-assistant/core/issues/149704
|
||||
Platform.CAMERA,
|
||||
Platform.LIGHT,
|
||||
Platform.SELECT,
|
||||
Platform.SWITCH,
|
||||
],
|
||||
"sp_rjKXWRohlvOTyLBu": [
|
||||
# https://github.com/home-assistant/core/issues/149704
|
||||
Platform.CAMERA,
|
||||
Platform.LIGHT,
|
||||
Platform.SELECT,
|
||||
Platform.SWITCH,
|
||||
],
|
||||
"sp_sdd5f5f2dl5wydjf": [
|
||||
# https://github.com/home-assistant/core/issues/144087
|
||||
Platform.CAMERA,
|
||||
Platform.NUMBER,
|
||||
Platform.SENSOR,
|
||||
Platform.SELECT,
|
||||
Platform.SIREN,
|
||||
Platform.SWITCH,
|
||||
],
|
||||
"tdq_cq1p0nt0a4rixnex": [
|
||||
# https://github.com/home-assistant/core/issues/146845
|
||||
Platform.SELECT,
|
||||
|
383
tests/components/tuya/fixtures/sp_sdd5f5f2dl5wydjf.json
Normal file
383
tests/components/tuya/fixtures/sp_sdd5f5f2dl5wydjf.json
Normal file
@@ -0,0 +1,383 @@
|
||||
{
|
||||
"endpoint": "https://apigw.tuyaeu.com",
|
||||
"terminal_id": "REDACTED",
|
||||
"mqtt_connected": true,
|
||||
"disabled_by": null,
|
||||
"disabled_polling": false,
|
||||
"id": "bf3f8b448bbc123e29oghf",
|
||||
"name": "C9",
|
||||
"category": "sp",
|
||||
"product_id": "sdd5f5f2dl5wydjf",
|
||||
"product_name": "Security Camera",
|
||||
"online": true,
|
||||
"sub": false,
|
||||
"time_zone": "+11:00",
|
||||
"active_time": "2025-03-13T07:28:30+00:00",
|
||||
"create_time": "2025-03-13T07:28:30+00:00",
|
||||
"update_time": "2025-03-13T07:28:30+00:00",
|
||||
"function": {
|
||||
"basic_flip": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"basic_osd": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"motion_sensitivity": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["0", "1", "2"]
|
||||
}
|
||||
},
|
||||
"basic_wdr": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"sd_format": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"motion_record": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"ptz_stop": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"ptz_control": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["0", "1", "2", "3", "4", "5", "6", "7"]
|
||||
}
|
||||
},
|
||||
"ipc_auto_siren": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"nightvision_mode": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["auto", "ir_mode", "color_mode"]
|
||||
}
|
||||
},
|
||||
"ptz_calibration": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"motion_switch": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"wireless_lowpower": {
|
||||
"type": "Integer",
|
||||
"value": {
|
||||
"min": 10,
|
||||
"max": 50,
|
||||
"scale": 0,
|
||||
"step": 1
|
||||
}
|
||||
},
|
||||
"wireless_awake": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"record_switch": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"record_mode": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["1", "2"]
|
||||
}
|
||||
},
|
||||
"pir_switch": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["0", "1", "2", "3", "4"]
|
||||
}
|
||||
},
|
||||
"siren_switch": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"basic_device_volume": {
|
||||
"type": "Integer",
|
||||
"value": {
|
||||
"unit": "",
|
||||
"min": 1,
|
||||
"max": 10,
|
||||
"scale": 0,
|
||||
"step": 1
|
||||
}
|
||||
},
|
||||
"motion_tracking": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"device_restart": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"humanoid_filter": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"cruise_switch": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"cruise_mode": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["0", "1"]
|
||||
}
|
||||
},
|
||||
"ipc_work_mode": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["0", "1"]
|
||||
}
|
||||
}
|
||||
},
|
||||
"status_range": {
|
||||
"basic_flip": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"basic_osd": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"motion_sensitivity": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["0", "1", "2"]
|
||||
}
|
||||
},
|
||||
"basic_wdr": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"sd_storge": {
|
||||
"type": "String",
|
||||
"value": {
|
||||
"maxlen": 255
|
||||
}
|
||||
},
|
||||
"sd_status": {
|
||||
"type": "Integer",
|
||||
"value": {
|
||||
"min": 1,
|
||||
"max": 5,
|
||||
"scale": 0,
|
||||
"step": 1
|
||||
}
|
||||
},
|
||||
"sd_format": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"motion_record": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"movement_detect_pic": {
|
||||
"type": "Raw",
|
||||
"value": {}
|
||||
},
|
||||
"ptz_stop": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"sd_format_state": {
|
||||
"type": "Integer",
|
||||
"value": {
|
||||
"min": -20000,
|
||||
"max": 200000,
|
||||
"scale": 0,
|
||||
"step": 1
|
||||
}
|
||||
},
|
||||
"ptz_control": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["0", "1", "2", "3", "4", "5", "6", "7"]
|
||||
}
|
||||
},
|
||||
"ipc_auto_siren": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"nightvision_mode": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["auto", "ir_mode", "color_mode"]
|
||||
}
|
||||
},
|
||||
"battery_report_cap": {
|
||||
"type": "Integer",
|
||||
"value": {
|
||||
"min": 0,
|
||||
"max": 15,
|
||||
"scale": 0,
|
||||
"step": 1
|
||||
}
|
||||
},
|
||||
"ptz_calibration": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"motion_switch": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"doorbell_active": {
|
||||
"type": "String",
|
||||
"value": {
|
||||
"maxlen": 255
|
||||
}
|
||||
},
|
||||
"wireless_electricity": {
|
||||
"type": "Integer",
|
||||
"value": {
|
||||
"unit": "%",
|
||||
"min": 0,
|
||||
"max": 100,
|
||||
"scale": 0,
|
||||
"step": 1
|
||||
}
|
||||
},
|
||||
"wireless_powermode": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["0", "1"]
|
||||
}
|
||||
},
|
||||
"wireless_lowpower": {
|
||||
"type": "Integer",
|
||||
"value": {
|
||||
"min": 10,
|
||||
"max": 50,
|
||||
"scale": 0,
|
||||
"step": 1
|
||||
}
|
||||
},
|
||||
"wireless_awake": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"record_switch": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"record_mode": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["1", "2"]
|
||||
}
|
||||
},
|
||||
"pir_switch": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["0", "1", "2", "3", "4"]
|
||||
}
|
||||
},
|
||||
"doorbell_pic": {
|
||||
"type": "Raw",
|
||||
"value": {}
|
||||
},
|
||||
"siren_switch": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"basic_device_volume": {
|
||||
"type": "Integer",
|
||||
"value": {
|
||||
"unit": "",
|
||||
"min": 1,
|
||||
"max": 10,
|
||||
"scale": 0,
|
||||
"step": 1
|
||||
}
|
||||
},
|
||||
"motion_tracking": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"device_restart": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"humanoid_filter": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"cruise_switch": {
|
||||
"type": "Boolean",
|
||||
"value": {}
|
||||
},
|
||||
"cruise_mode": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["0", "1"]
|
||||
}
|
||||
},
|
||||
"alarm_message": {
|
||||
"type": "String",
|
||||
"value": {}
|
||||
},
|
||||
"ipc_work_mode": {
|
||||
"type": "Enum",
|
||||
"value": {
|
||||
"range": ["0", "1"]
|
||||
}
|
||||
},
|
||||
"initiative_message": {
|
||||
"type": "Raw",
|
||||
"value": {}
|
||||
}
|
||||
},
|
||||
"status": {
|
||||
"basic_flip": false,
|
||||
"basic_osd": true,
|
||||
"motion_sensitivity": 1,
|
||||
"basic_wdr": false,
|
||||
"sd_storge": "30932992|3407872|27525120",
|
||||
"sd_status": 1,
|
||||
"sd_format": false,
|
||||
"motion_record": false,
|
||||
"movement_detect_pic": "**REDACTED**",
|
||||
"ptz_stop": true,
|
||||
"sd_format_state": 0,
|
||||
"ptz_control": 5,
|
||||
"ipc_auto_siren": false,
|
||||
"nightvision_mode": "auto",
|
||||
"battery_report_cap": 1,
|
||||
"ptz_calibration": false,
|
||||
"motion_switch": true,
|
||||
"doorbell_active": "",
|
||||
"wireless_electricity": 80,
|
||||
"wireless_powermode": 0,
|
||||
"wireless_lowpower": 10,
|
||||
"wireless_awake": false,
|
||||
"record_switch": true,
|
||||
"record_mode": 1,
|
||||
"pir_switch": 2,
|
||||
"doorbell_pic": "",
|
||||
"siren_switch": false,
|
||||
"basic_device_volume": 1,
|
||||
"motion_tracking": true,
|
||||
"device_restart": false,
|
||||
"humanoid_filter": true,
|
||||
"cruise_switch": false,
|
||||
"cruise_mode": 0,
|
||||
"alarm_message": "**REDACTED**",
|
||||
"ipc_work_mode": 0,
|
||||
"initiative_message": ""
|
||||
},
|
||||
"set_up": true,
|
||||
"support_local": false
|
||||
}
|
162
tests/components/tuya/snapshots/test_camera.ambr
Normal file
162
tests/components/tuya/snapshots/test_camera.ambr
Normal file
@@ -0,0 +1,162 @@
|
||||
# serializer version: 1
|
||||
# name: test_platform_setup_and_discovery[sp_drezasavompxpcgm][camera.cam_garage-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': 'camera',
|
||||
'entity_category': None,
|
||||
'entity_id': 'camera.cam_garage',
|
||||
'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': None,
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': <CameraEntityFeature: 2>,
|
||||
'translation_key': None,
|
||||
'unique_id': 'tuya.bf7b8e59f8cd49f425mmfm',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_drezasavompxpcgm][camera.cam_garage-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'access_token': '1',
|
||||
'brand': 'Tuya',
|
||||
'entity_picture': '/api/camera_proxy/camera.cam_garage?token=1',
|
||||
'friendly_name': 'CAM GARAGE',
|
||||
'model_name': 'Indoor camera ',
|
||||
'motion_detection': True,
|
||||
'supported_features': <CameraEntityFeature: 2>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'camera.cam_garage',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'idle',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_rjKXWRohlvOTyLBu][camera.cam_porch-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': 'camera',
|
||||
'entity_category': None,
|
||||
'entity_id': 'camera.cam_porch',
|
||||
'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': None,
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': <CameraEntityFeature: 2>,
|
||||
'translation_key': None,
|
||||
'unique_id': 'tuya.bf9d5b7ea61ea4c9a6rom9',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_rjKXWRohlvOTyLBu][camera.cam_porch-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'access_token': '1',
|
||||
'brand': 'Tuya',
|
||||
'entity_picture': '/api/camera_proxy/camera.cam_porch?token=1',
|
||||
'friendly_name': 'CAM PORCH',
|
||||
'model_name': 'Indoor cam Pan/Tilt ',
|
||||
'supported_features': <CameraEntityFeature: 2>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'camera.cam_porch',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'idle',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][camera.c9-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': 'camera',
|
||||
'entity_category': None,
|
||||
'entity_id': 'camera.c9',
|
||||
'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': None,
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': <CameraEntityFeature: 2>,
|
||||
'translation_key': None,
|
||||
'unique_id': 'tuya.bf3f8b448bbc123e29oghf',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][camera.c9-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'access_token': '1',
|
||||
'brand': 'Tuya',
|
||||
'entity_picture': '/api/camera_proxy/camera.c9?token=1',
|
||||
'friendly_name': 'C9',
|
||||
'model_name': 'Security Camera',
|
||||
'motion_detection': True,
|
||||
'supported_features': <CameraEntityFeature: 2>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'camera.c9',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'recording',
|
||||
})
|
||||
# ---
|
@@ -527,6 +527,64 @@
|
||||
'state': '10.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][number.c9_volume-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'max': 10.0,
|
||||
'min': 1.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.c9_volume',
|
||||
'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': 'Volume',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'volume',
|
||||
'unique_id': 'tuya.bf3f8b448bbc123e29oghfbasic_device_volume',
|
||||
'unit_of_measurement': '',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][number.c9_volume-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'C9 Volume',
|
||||
'max': 10.0,
|
||||
'min': 1.0,
|
||||
'mode': <NumberMode.AUTO: 'auto'>,
|
||||
'step': 1.0,
|
||||
'unit_of_measurement': '',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'number.c9_volume',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '1.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[wk_fi6dne5tu4t1nm6j][number.wifi_smart_gas_boiler_thermostat_temperature_correction-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
@@ -945,6 +945,179 @@
|
||||
'state': 'unknown',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][select.c9_ipc_mode-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'options': list([
|
||||
'0',
|
||||
'1',
|
||||
]),
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'select',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'select.c9_ipc_mode',
|
||||
'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': 'IPC mode',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'ipc_work_mode',
|
||||
'unique_id': 'tuya.bf3f8b448bbc123e29oghfipc_work_mode',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][select.c9_ipc_mode-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'C9 IPC mode',
|
||||
'options': list([
|
||||
'0',
|
||||
'1',
|
||||
]),
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'select.c9_ipc_mode',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unknown',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][select.c9_motion_detection_sensitivity-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'options': list([
|
||||
'0',
|
||||
'1',
|
||||
'2',
|
||||
]),
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'select',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'select.c9_motion_detection_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': 'Motion detection sensitivity',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'motion_sensitivity',
|
||||
'unique_id': 'tuya.bf3f8b448bbc123e29oghfmotion_sensitivity',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][select.c9_motion_detection_sensitivity-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'C9 Motion detection sensitivity',
|
||||
'options': list([
|
||||
'0',
|
||||
'1',
|
||||
'2',
|
||||
]),
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'select.c9_motion_detection_sensitivity',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unknown',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][select.c9_record_mode-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
'area_id': None,
|
||||
'capabilities': dict({
|
||||
'options': list([
|
||||
'1',
|
||||
'2',
|
||||
]),
|
||||
}),
|
||||
'config_entry_id': <ANY>,
|
||||
'config_subentry_id': <ANY>,
|
||||
'device_class': None,
|
||||
'device_id': <ANY>,
|
||||
'disabled_by': None,
|
||||
'domain': 'select',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'select.c9_record_mode',
|
||||
'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': 'Record mode',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'record_mode',
|
||||
'unique_id': 'tuya.bf3f8b448bbc123e29oghfrecord_mode',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][select.c9_record_mode-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'C9 Record mode',
|
||||
'options': list([
|
||||
'1',
|
||||
'2',
|
||||
]),
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'select.c9_record_mode',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'unknown',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[tdq_cq1p0nt0a4rixnex][select.4_433_power_on_behavior-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
@@ -2556,6 +2556,59 @@
|
||||
'state': '0.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][sensor.c9_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.c9_battery',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
'id': <ANY>,
|
||||
'labels': set({
|
||||
}),
|
||||
'name': None,
|
||||
'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.bf3f8b448bbc123e29oghfwireless_electricity',
|
||||
'unit_of_measurement': '%',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][sensor.c9_battery-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'device_class': 'battery',
|
||||
'friendly_name': 'C9 Battery',
|
||||
'state_class': <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': '%',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.c9_battery',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': '80.0',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[tyndj_pyakuuoc][sensor.solar_zijpad_battery-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
@@ -97,3 +97,52 @@
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][siren.c9-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': 'siren',
|
||||
'entity_category': None,
|
||||
'entity_id': 'siren.c9',
|
||||
'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': None,
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': <SirenEntityFeature: 3>,
|
||||
'translation_key': None,
|
||||
'unique_id': 'tuya.bf3f8b448bbc123e29oghfsiren_switch',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][siren.c9-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'C9',
|
||||
'supported_features': <SirenEntityFeature: 3>,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'siren.c9',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
|
@@ -1934,6 +1934,342 @@
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][switch.c9_flip-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': 'switch',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'switch.c9_flip',
|
||||
'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': 'Flip',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'flip',
|
||||
'unique_id': 'tuya.bf3f8b448bbc123e29oghfbasic_flip',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][switch.c9_flip-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'C9 Flip',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.c9_flip',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][switch.c9_motion_alarm-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': 'switch',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'switch.c9_motion_alarm',
|
||||
'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': 'Motion alarm',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'motion_alarm',
|
||||
'unique_id': 'tuya.bf3f8b448bbc123e29oghfmotion_switch',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][switch.c9_motion_alarm-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'C9 Motion alarm',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.c9_motion_alarm',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'on',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][switch.c9_motion_recording-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': 'switch',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'switch.c9_motion_recording',
|
||||
'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': 'Motion recording',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'motion_recording',
|
||||
'unique_id': 'tuya.bf3f8b448bbc123e29oghfmotion_record',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][switch.c9_motion_recording-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'C9 Motion recording',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.c9_motion_recording',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][switch.c9_motion_tracking-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': 'switch',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'switch.c9_motion_tracking',
|
||||
'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': 'Motion tracking',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'motion_tracking',
|
||||
'unique_id': 'tuya.bf3f8b448bbc123e29oghfmotion_tracking',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][switch.c9_motion_tracking-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'C9 Motion tracking',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.c9_motion_tracking',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'on',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][switch.c9_time_watermark-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': 'switch',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'switch.c9_time_watermark',
|
||||
'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': 'Time watermark',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'time_watermark',
|
||||
'unique_id': 'tuya.bf3f8b448bbc123e29oghfbasic_osd',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][switch.c9_time_watermark-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'C9 Time watermark',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.c9_time_watermark',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'on',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][switch.c9_video_recording-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': 'switch',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'switch.c9_video_recording',
|
||||
'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': 'Video recording',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'video_recording',
|
||||
'unique_id': 'tuya.bf3f8b448bbc123e29oghfrecord_switch',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][switch.c9_video_recording-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'C9 Video recording',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.c9_video_recording',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'on',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][switch.c9_wide_dynamic_range-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': 'switch',
|
||||
'entity_category': <EntityCategory.CONFIG: 'config'>,
|
||||
'entity_id': 'switch.c9_wide_dynamic_range',
|
||||
'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': 'Wide dynamic range',
|
||||
'platform': 'tuya',
|
||||
'previous_unique_id': None,
|
||||
'suggested_object_id': None,
|
||||
'supported_features': 0,
|
||||
'translation_key': 'wide_dynamic_range',
|
||||
'unique_id': 'tuya.bf3f8b448bbc123e29oghfbasic_wdr',
|
||||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[sp_sdd5f5f2dl5wydjf][switch.c9_wide_dynamic_range-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'C9 Wide dynamic range',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'switch.c9_wide_dynamic_range',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'off',
|
||||
})
|
||||
# ---
|
||||
# name: test_platform_setup_and_discovery[tdq_cq1p0nt0a4rixnex][switch.4_433_switch_1-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
|
73
tests/components/tuya/test_camera.py
Normal file
73
tests/components/tuya/test_camera.py
Normal file
@@ -0,0 +1,73 @@
|
||||
"""Test Tuya camera platform."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from unittest.mock import patch
|
||||
|
||||
import pytest
|
||||
from syrupy.assertion import SnapshotAssertion
|
||||
from tuya_sharing import CustomerDevice
|
||||
|
||||
from homeassistant.components.tuya import ManagerCompat
|
||||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
|
||||
from . import DEVICE_MOCKS, initialize_entry
|
||||
|
||||
from tests.common import MockConfigEntry, snapshot_platform
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_getrandbits():
|
||||
"""Mock camera access token which normally is randomized."""
|
||||
with patch(
|
||||
"homeassistant.components.camera.SystemRandom.getrandbits",
|
||||
return_value=1,
|
||||
):
|
||||
yield
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"mock_device_code",
|
||||
[k for k, v in DEVICE_MOCKS.items() if Platform.CAMERA in v],
|
||||
)
|
||||
@patch("homeassistant.components.tuya.PLATFORMS", [Platform.CAMERA])
|
||||
async def test_platform_setup_and_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: ManagerCompat,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
mock_device: CustomerDevice,
|
||||
entity_registry: er.EntityRegistry,
|
||||
snapshot: SnapshotAssertion,
|
||||
) -> None:
|
||||
"""Test platform setup and discovery."""
|
||||
|
||||
await initialize_entry(hass, mock_manager, mock_config_entry, mock_device)
|
||||
|
||||
await snapshot_platform(
|
||||
hass,
|
||||
entity_registry,
|
||||
snapshot,
|
||||
mock_config_entry.entry_id,
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"mock_device_code",
|
||||
[k for k, v in DEVICE_MOCKS.items() if Platform.CAMERA not in v],
|
||||
)
|
||||
@patch("homeassistant.components.tuya.PLATFORMS", [Platform.CAMERA])
|
||||
async def test_platform_setup_no_discovery(
|
||||
hass: HomeAssistant,
|
||||
mock_manager: ManagerCompat,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
mock_device: CustomerDevice,
|
||||
entity_registry: er.EntityRegistry,
|
||||
) -> None:
|
||||
"""Test platform setup without discovery."""
|
||||
await initialize_entry(hass, mock_manager, mock_config_entry, mock_device)
|
||||
|
||||
assert not er.async_entries_for_config_entry(
|
||||
entity_registry, mock_config_entry.entry_id
|
||||
)
|
Reference in New Issue
Block a user