mirror of
https://github.com/home-assistant/core.git
synced 2026-04-02 00:20:30 +01:00
Update Overkiz test fixtures and diagnostics to use more realistic fixture (#165615)
This commit is contained in:
@@ -7,7 +7,7 @@ from tests.common import load_json_object_fixture
|
||||
|
||||
|
||||
def load_setup_fixture(
|
||||
fixture: str = "overkiz/setup_tahoma_switch.json",
|
||||
fixture: str = "overkiz/setup/setup_tahoma_switch.json",
|
||||
) -> Setup:
|
||||
"""Return setup from fixture."""
|
||||
setup_json = load_json_object_fixture(fixture)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"creationTime": 1665238624000,
|
||||
"lastUpdateTime": 1665238624000,
|
||||
"id": "SETUP-****-****-6867",
|
||||
"id": "SETUP-1234-5678-6867",
|
||||
"location": {
|
||||
"creationTime": 1665238624000,
|
||||
"lastUpdateTime": 1667054735000,
|
||||
@@ -25,7 +25,7 @@
|
||||
},
|
||||
"gateways": [
|
||||
{
|
||||
"gatewayId": "****-****-6867",
|
||||
"gatewayId": "1234-5678-6867",
|
||||
"type": 98,
|
||||
"subType": 1,
|
||||
"placeOID": "41d63e43-bfa8-4e24-8c16-4faae0448cab",
|
||||
@@ -48,7 +48,7 @@
|
||||
"creationTime": 1665238630000,
|
||||
"lastUpdateTime": 1665238630000,
|
||||
"label": "** *(**)*",
|
||||
"deviceURL": "homekit://****-****-6867/stack",
|
||||
"deviceURL": "homekit://1234-5678-6867/stack",
|
||||
"shortcut": false,
|
||||
"controllableName": "homekit:StackComponent",
|
||||
"definition": {
|
||||
@@ -90,7 +90,7 @@
|
||||
"creationTime": 1665238630000,
|
||||
"lastUpdateTime": 1665238630000,
|
||||
"label": "**",
|
||||
"deviceURL": "internal://****-****-6867/pod/0",
|
||||
"deviceURL": "internal://1234-5678-6867/pod/0",
|
||||
"shortcut": false,
|
||||
"controllableName": "internal:PodV3Component",
|
||||
"definition": {
|
||||
@@ -242,7 +242,7 @@
|
||||
"creationTime": 1665238630000,
|
||||
"lastUpdateTime": 1665238630000,
|
||||
"label": "** *(**/**)*",
|
||||
"deviceURL": "internal://****-****-6867/wifi/0",
|
||||
"deviceURL": "internal://1234-5678-6867/wifi/0",
|
||||
"shortcut": false,
|
||||
"controllableName": "internal:WifiComponent",
|
||||
"definition": {
|
||||
@@ -310,7 +310,7 @@
|
||||
"creationTime": 1665238924000,
|
||||
"lastUpdateTime": 1665238924000,
|
||||
"label": "** *(**)*",
|
||||
"deviceURL": "io://****-****-6867/4167385",
|
||||
"deviceURL": "io://1234-5678-6867/4167385",
|
||||
"shortcut": false,
|
||||
"controllableName": "io:StackComponent",
|
||||
"definition": {
|
||||
@@ -368,7 +368,7 @@
|
||||
"creationTime": 1665238637000,
|
||||
"lastUpdateTime": 1665238637000,
|
||||
"label": "** ** **",
|
||||
"deviceURL": "ogp://****-****-6867/00000BE8",
|
||||
"deviceURL": "ogp://1234-5678-6867/00000BE8",
|
||||
"shortcut": false,
|
||||
"controllableName": "ogp:Bridge",
|
||||
"definition": {
|
||||
@@ -496,7 +496,7 @@
|
||||
"creationTime": 1665238799000,
|
||||
"lastUpdateTime": 1665238799000,
|
||||
"label": "** ** **",
|
||||
"deviceURL": "ogp://****-****-6867/0003FEF3",
|
||||
"deviceURL": "ogp://1234-5678-6867/0003FEF3",
|
||||
"shortcut": false,
|
||||
"controllableName": "ogp:Bridge",
|
||||
"definition": {
|
||||
@@ -584,7 +584,7 @@
|
||||
"creationTime": 1665238637000,
|
||||
"lastUpdateTime": 1665238637000,
|
||||
"label": "** ** **",
|
||||
"deviceURL": "ogp://****-****-6867/039575E9",
|
||||
"deviceURL": "ogp://1234-5678-6867/039575E9",
|
||||
"shortcut": false,
|
||||
"controllableName": "ogp:Bridge",
|
||||
"definition": {
|
||||
@@ -672,7 +672,7 @@
|
||||
"creationTime": 1665238637000,
|
||||
"lastUpdateTime": 1665238637000,
|
||||
"label": "** ** **",
|
||||
"deviceURL": "ogp://****-****-6867/09E45393",
|
||||
"deviceURL": "ogp://1234-5678-6867/09E45393",
|
||||
"shortcut": false,
|
||||
"controllableName": "ogp:Bridge",
|
||||
"definition": {
|
||||
@@ -759,8 +759,8 @@
|
||||
{
|
||||
"creationTime": 1667840384000,
|
||||
"lastUpdateTime": 1667840384000,
|
||||
"label": "** ** **",
|
||||
"deviceURL": "rts://****-****-6867/16756006",
|
||||
"label": "Living Room Shutter",
|
||||
"deviceURL": "rts://1234-5678-6867/16756006",
|
||||
"shortcut": false,
|
||||
"controllableName": "rts:RollerShutterRTSComponent",
|
||||
"definition": {
|
||||
@@ -838,7 +838,7 @@
|
||||
"creationTime": 1665238630000,
|
||||
"lastUpdateTime": 1665238630000,
|
||||
"label": "** *(**)*",
|
||||
"deviceURL": "zigbee://****-****-6867/65535",
|
||||
"deviceURL": "zigbee://1234-5678-6867/65535",
|
||||
"shortcut": false,
|
||||
"controllableName": "zigbee:TransceiverV3_0Component",
|
||||
"definition": {
|
||||
@@ -872,14 +872,14 @@
|
||||
"rootPlace": {
|
||||
"creationTime": 1665238624000,
|
||||
"lastUpdateTime": 1665238630000,
|
||||
"label": "** **",
|
||||
"label": "My House",
|
||||
"type": 200,
|
||||
"oid": "41d63e43-bfa8-4e24-8c16-4faae0448cab",
|
||||
"subPlaces": [
|
||||
{
|
||||
"creationTime": 1667840432000,
|
||||
"lastUpdateTime": 1667840432000,
|
||||
"label": "**",
|
||||
"label": "Living Room",
|
||||
"type": 108,
|
||||
"metadata": "{\"color\":\"#08C27F\"}",
|
||||
"oid": "9e3d6899-50bb-4869-9c5e-46c2b57f7c9e",
|
||||
@@ -49,7 +49,7 @@
|
||||
]),
|
||||
'widgetName': 'HomekitStack',
|
||||
}),
|
||||
'deviceURL': 'homekit://****-****-6867/stack',
|
||||
'deviceURL': 'homekit://1234-5678-6867/stack',
|
||||
'enabled': True,
|
||||
'label': '** *(**)*',
|
||||
'lastUpdateTime': 1665238630000,
|
||||
@@ -179,7 +179,7 @@
|
||||
]),
|
||||
'widgetName': 'Pod',
|
||||
}),
|
||||
'deviceURL': 'internal://****-****-6867/pod/0',
|
||||
'deviceURL': 'internal://1234-5678-6867/pod/0',
|
||||
'enabled': True,
|
||||
'label': '**',
|
||||
'lastUpdateTime': 1665238630000,
|
||||
@@ -270,7 +270,7 @@
|
||||
]),
|
||||
'widgetName': 'Wifi',
|
||||
}),
|
||||
'deviceURL': 'internal://****-****-6867/wifi/0',
|
||||
'deviceURL': 'internal://1234-5678-6867/wifi/0',
|
||||
'enabled': True,
|
||||
'label': '** *(**/**)*',
|
||||
'lastUpdateTime': 1665238630000,
|
||||
@@ -349,7 +349,7 @@
|
||||
]),
|
||||
'widgetName': 'IOStack',
|
||||
}),
|
||||
'deviceURL': 'io://****-****-6867/4167385',
|
||||
'deviceURL': 'io://1234-5678-6867/4167385',
|
||||
'enabled': True,
|
||||
'label': '** *(**)*',
|
||||
'lastUpdateTime': 1665238924000,
|
||||
@@ -476,7 +476,7 @@
|
||||
]),
|
||||
'widgetName': 'DynamicBridge',
|
||||
}),
|
||||
'deviceURL': 'ogp://****-****-6867/00000BE8',
|
||||
'deviceURL': 'ogp://1234-5678-6867/00000BE8',
|
||||
'enabled': True,
|
||||
'label': '** ** **',
|
||||
'lastUpdateTime': 1665238637000,
|
||||
@@ -570,7 +570,7 @@
|
||||
]),
|
||||
'widgetName': 'DynamicBridge',
|
||||
}),
|
||||
'deviceURL': 'ogp://****-****-6867/0003FEF3',
|
||||
'deviceURL': 'ogp://1234-5678-6867/0003FEF3',
|
||||
'enabled': True,
|
||||
'label': '** ** **',
|
||||
'lastUpdateTime': 1665238799000,
|
||||
@@ -664,7 +664,7 @@
|
||||
]),
|
||||
'widgetName': 'DynamicBridge',
|
||||
}),
|
||||
'deviceURL': 'ogp://****-****-6867/039575E9',
|
||||
'deviceURL': 'ogp://1234-5678-6867/039575E9',
|
||||
'enabled': True,
|
||||
'label': '** ** **',
|
||||
'lastUpdateTime': 1665238637000,
|
||||
@@ -758,7 +758,7 @@
|
||||
]),
|
||||
'widgetName': 'DynamicBridge',
|
||||
}),
|
||||
'deviceURL': 'ogp://****-****-6867/09E45393',
|
||||
'deviceURL': 'ogp://1234-5678-6867/09E45393',
|
||||
'enabled': True,
|
||||
'label': '** ** **',
|
||||
'lastUpdateTime': 1665238637000,
|
||||
@@ -847,9 +847,9 @@
|
||||
]),
|
||||
'widgetName': 'UpDownRollerShutter',
|
||||
}),
|
||||
'deviceURL': 'rts://****-****-6867/16756006',
|
||||
'deviceURL': 'rts://1234-5678-6867/16756006',
|
||||
'enabled': True,
|
||||
'label': '** ** **',
|
||||
'label': 'Living Room Shutter',
|
||||
'lastUpdateTime': 1667840384000,
|
||||
'oid': '1a10d6f6-9bc3-40f3-a33c-e383fd41d3e8',
|
||||
'placeOID': '9e3d6899-50bb-4869-9c5e-46c2b57f7c9e',
|
||||
@@ -877,7 +877,7 @@
|
||||
]),
|
||||
'widgetName': 'ZigbeeStack',
|
||||
}),
|
||||
'deviceURL': 'zigbee://****-****-6867/65535',
|
||||
'deviceURL': 'zigbee://1234-5678-6867/65535',
|
||||
'enabled': True,
|
||||
'label': '** *(**)*',
|
||||
'lastUpdateTime': 1665238630000,
|
||||
@@ -908,7 +908,7 @@
|
||||
'status': 'OK',
|
||||
}),
|
||||
'functions': 'INTERNET_AUTHORIZATION,SCENARIO_DOWNLOAD,SCENARIO_AUTO_LAUNCHING,SCENARIO_TELECO_LAUNCHING,INTERNET_UPLOAD,INTERNET_UPDATE,TRIGGERS_SENSORS',
|
||||
'gatewayId': '****-****-6867',
|
||||
'gatewayId': '1234-5678-6867',
|
||||
'mode': 'ACTIVE',
|
||||
'placeOID': '41d63e43-bfa8-4e24-8c16-4faae0448cab',
|
||||
'subType': 1,
|
||||
@@ -919,7 +919,7 @@
|
||||
'updateStatus': 'UP_TO_DATE',
|
||||
}),
|
||||
]),
|
||||
'id': 'SETUP-****-****-6867',
|
||||
'id': 'SETUP-1234-5678-6867',
|
||||
'lastUpdateTime': 1665238624000,
|
||||
'location': dict({
|
||||
'addressLine1': '** **',
|
||||
@@ -946,13 +946,13 @@
|
||||
'resellerDelegationType': 'NEVER',
|
||||
'rootPlace': dict({
|
||||
'creationTime': 1665238624000,
|
||||
'label': '** **',
|
||||
'label': 'My House',
|
||||
'lastUpdateTime': 1665238630000,
|
||||
'oid': '41d63e43-bfa8-4e24-8c16-4faae0448cab',
|
||||
'subPlaces': list([
|
||||
dict({
|
||||
'creationTime': 1667840432000,
|
||||
'label': '**',
|
||||
'label': 'Living Room',
|
||||
'lastUpdateTime': 1667840432000,
|
||||
'metadata': '{"color":"#08C27F"}',
|
||||
'oid': '9e3d6899-50bb-4869-9c5e-46c2b57f7c9e',
|
||||
@@ -1012,7 +1012,7 @@
|
||||
]),
|
||||
'widgetName': 'HomekitStack',
|
||||
}),
|
||||
'deviceURL': 'homekit://****-****-6867/stack',
|
||||
'deviceURL': 'homekit://1234-5678-6867/stack',
|
||||
'enabled': True,
|
||||
'label': '** *(**)*',
|
||||
'lastUpdateTime': 1665238630000,
|
||||
@@ -1142,7 +1142,7 @@
|
||||
]),
|
||||
'widgetName': 'Pod',
|
||||
}),
|
||||
'deviceURL': 'internal://****-****-6867/pod/0',
|
||||
'deviceURL': 'internal://1234-5678-6867/pod/0',
|
||||
'enabled': True,
|
||||
'label': '**',
|
||||
'lastUpdateTime': 1665238630000,
|
||||
@@ -1233,7 +1233,7 @@
|
||||
]),
|
||||
'widgetName': 'Wifi',
|
||||
}),
|
||||
'deviceURL': 'internal://****-****-6867/wifi/0',
|
||||
'deviceURL': 'internal://1234-5678-6867/wifi/0',
|
||||
'enabled': True,
|
||||
'label': '** *(**/**)*',
|
||||
'lastUpdateTime': 1665238630000,
|
||||
@@ -1312,7 +1312,7 @@
|
||||
]),
|
||||
'widgetName': 'IOStack',
|
||||
}),
|
||||
'deviceURL': 'io://****-****-6867/4167385',
|
||||
'deviceURL': 'io://1234-5678-6867/4167385',
|
||||
'enabled': True,
|
||||
'label': '** *(**)*',
|
||||
'lastUpdateTime': 1665238924000,
|
||||
@@ -1439,7 +1439,7 @@
|
||||
]),
|
||||
'widgetName': 'DynamicBridge',
|
||||
}),
|
||||
'deviceURL': 'ogp://****-****-6867/00000BE8',
|
||||
'deviceURL': 'ogp://1234-5678-6867/00000BE8',
|
||||
'enabled': True,
|
||||
'label': '** ** **',
|
||||
'lastUpdateTime': 1665238637000,
|
||||
@@ -1533,7 +1533,7 @@
|
||||
]),
|
||||
'widgetName': 'DynamicBridge',
|
||||
}),
|
||||
'deviceURL': 'ogp://****-****-6867/0003FEF3',
|
||||
'deviceURL': 'ogp://1234-5678-6867/0003FEF3',
|
||||
'enabled': True,
|
||||
'label': '** ** **',
|
||||
'lastUpdateTime': 1665238799000,
|
||||
@@ -1627,7 +1627,7 @@
|
||||
]),
|
||||
'widgetName': 'DynamicBridge',
|
||||
}),
|
||||
'deviceURL': 'ogp://****-****-6867/039575E9',
|
||||
'deviceURL': 'ogp://1234-5678-6867/039575E9',
|
||||
'enabled': True,
|
||||
'label': '** ** **',
|
||||
'lastUpdateTime': 1665238637000,
|
||||
@@ -1721,7 +1721,7 @@
|
||||
]),
|
||||
'widgetName': 'DynamicBridge',
|
||||
}),
|
||||
'deviceURL': 'ogp://****-****-6867/09E45393',
|
||||
'deviceURL': 'ogp://1234-5678-6867/09E45393',
|
||||
'enabled': True,
|
||||
'label': '** ** **',
|
||||
'lastUpdateTime': 1665238637000,
|
||||
@@ -1810,9 +1810,9 @@
|
||||
]),
|
||||
'widgetName': 'UpDownRollerShutter',
|
||||
}),
|
||||
'deviceURL': 'rts://****-****-6867/16756006',
|
||||
'deviceURL': 'rts://1234-5678-6867/16756006',
|
||||
'enabled': True,
|
||||
'label': '** ** **',
|
||||
'label': 'Living Room Shutter',
|
||||
'lastUpdateTime': 1667840384000,
|
||||
'oid': '1a10d6f6-9bc3-40f3-a33c-e383fd41d3e8',
|
||||
'placeOID': '9e3d6899-50bb-4869-9c5e-46c2b57f7c9e',
|
||||
@@ -1840,7 +1840,7 @@
|
||||
]),
|
||||
'widgetName': 'ZigbeeStack',
|
||||
}),
|
||||
'deviceURL': 'zigbee://****-****-6867/65535',
|
||||
'deviceURL': 'zigbee://1234-5678-6867/65535',
|
||||
'enabled': True,
|
||||
'label': '** *(**)*',
|
||||
'lastUpdateTime': 1665238630000,
|
||||
@@ -1871,7 +1871,7 @@
|
||||
'status': 'OK',
|
||||
}),
|
||||
'functions': 'INTERNET_AUTHORIZATION,SCENARIO_DOWNLOAD,SCENARIO_AUTO_LAUNCHING,SCENARIO_TELECO_LAUNCHING,INTERNET_UPLOAD,INTERNET_UPDATE,TRIGGERS_SENSORS',
|
||||
'gatewayId': '****-****-6867',
|
||||
'gatewayId': '1234-5678-6867',
|
||||
'mode': 'ACTIVE',
|
||||
'placeOID': '41d63e43-bfa8-4e24-8c16-4faae0448cab',
|
||||
'subType': 1,
|
||||
@@ -1882,7 +1882,7 @@
|
||||
'updateStatus': 'UP_TO_DATE',
|
||||
}),
|
||||
]),
|
||||
'id': 'SETUP-****-****-6867',
|
||||
'id': 'SETUP-1234-5678-6867',
|
||||
'lastUpdateTime': 1665238624000,
|
||||
'location': dict({
|
||||
'addressLine1': '** **',
|
||||
@@ -1909,13 +1909,13 @@
|
||||
'resellerDelegationType': 'NEVER',
|
||||
'rootPlace': dict({
|
||||
'creationTime': 1665238624000,
|
||||
'label': '** **',
|
||||
'label': 'My House',
|
||||
'lastUpdateTime': 1665238630000,
|
||||
'oid': '41d63e43-bfa8-4e24-8c16-4faae0448cab',
|
||||
'subPlaces': list([
|
||||
dict({
|
||||
'creationTime': 1667840432000,
|
||||
'label': '**',
|
||||
'label': 'Living Room',
|
||||
'lastUpdateTime': 1667840432000,
|
||||
'metadata': '{"color":"#08C27F"}',
|
||||
'oid': '9e3d6899-50bb-4869-9c5e-46c2b57f7c9e',
|
||||
|
||||
@@ -24,7 +24,7 @@ async def test_diagnostics(
|
||||
) -> None:
|
||||
"""Test diagnostics."""
|
||||
diagnostic_data = await async_load_json_object_fixture(
|
||||
hass, "setup_tahoma_switch.json", DOMAIN
|
||||
hass, "setup/setup_tahoma_switch.json", DOMAIN
|
||||
)
|
||||
|
||||
with patch.multiple(
|
||||
@@ -47,11 +47,11 @@ async def test_device_diagnostics(
|
||||
) -> None:
|
||||
"""Test device diagnostics."""
|
||||
diagnostic_data = await async_load_json_object_fixture(
|
||||
hass, "setup_tahoma_switch.json", DOMAIN
|
||||
hass, "setup/setup_tahoma_switch.json", DOMAIN
|
||||
)
|
||||
|
||||
device = device_registry.async_get_device(
|
||||
identifiers={(DOMAIN, "rts://****-****-6867/16756006")}
|
||||
identifiers={(DOMAIN, "rts://1234-5678-6867/16756006")}
|
||||
)
|
||||
assert device is not None
|
||||
|
||||
@@ -77,11 +77,11 @@ async def test_device_diagnostics_execution_history_subsystem(
|
||||
"""Test execution history matching ignores subsystem suffix."""
|
||||
|
||||
diagnostic_data = await async_load_json_object_fixture(
|
||||
hass, "setup_tahoma_switch.json", DOMAIN
|
||||
hass, "setup/setup_tahoma_switch.json", DOMAIN
|
||||
)
|
||||
|
||||
device = device_registry.async_get_device(
|
||||
identifiers={(DOMAIN, "rts://****-****-6867/16756006")}
|
||||
identifiers={(DOMAIN, "rts://1234-5678-6867/16756006")}
|
||||
)
|
||||
assert device is not None
|
||||
|
||||
@@ -98,8 +98,8 @@ async def test_device_diagnostics_execution_history_subsystem(
|
||||
return f"Execution({self.name})"
|
||||
|
||||
execution_history = [
|
||||
_FakeExecution("matching", ["rts://****-****-6867/16756006#2"]),
|
||||
_FakeExecution("other", ["rts://****-****-6867/other_device"]),
|
||||
_FakeExecution("matching", ["rts://1234-5678-6867/16756006#2"]),
|
||||
_FakeExecution("other", ["rts://1234-5678-6867/other_device"]),
|
||||
]
|
||||
|
||||
with patch.multiple(
|
||||
|
||||
Reference in New Issue
Block a user