From b92f718e082c82db369ff5eea56ee8d039272a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20BOU=C3=89?= Date: Wed, 30 Apr 2025 22:09:29 +0200 Subject: [PATCH] Matter Cooktop fixture (#143984) --- tests/components/matter/conftest.py | 1 + .../matter/fixtures/nodes/cooktop.json | 308 ++++++++++++++++++ .../matter/snapshots/test_select.ambr | 58 ++++ .../matter/snapshots/test_sensor.ambr | 52 +++ .../matter/snapshots/test_switch.ambr | 96 ++++++ 5 files changed, 515 insertions(+) create mode 100644 tests/components/matter/fixtures/nodes/cooktop.json diff --git a/tests/components/matter/conftest.py b/tests/components/matter/conftest.py index e180b9e9363..04aeba4546f 100644 --- a/tests/components/matter/conftest.py +++ b/tests/components/matter/conftest.py @@ -76,6 +76,7 @@ async def integration_fixture( "air_purifier", "air_quality_sensor", "color_temperature_light", + "cooktop", "dimmable_light", "dimmable_plugin_unit", "door_lock", diff --git a/tests/components/matter/fixtures/nodes/cooktop.json b/tests/components/matter/fixtures/nodes/cooktop.json new file mode 100644 index 00000000000..f32322b6cb7 --- /dev/null +++ b/tests/components/matter/fixtures/nodes/cooktop.json @@ -0,0 +1,308 @@ +{ + "node_id": 3, + "date_commissioned": "2025-04-29T15:54:11.963738", + "last_interview": "2025-04-29T15:54:11.963750", + "interview_version": 6, + "available": true, + "is_bridge": false, + "attributes": { + "0/29/0": [ + { + "0": 22, + "1": 3 + } + ], + "0/29/1": [29, 31, 40, 43, 45, 48, 49, 51, 54, 60, 62, 63], + "0/29/2": [], + "0/29/3": [1, 2], + "0/29/65532": 0, + "0/29/65533": 2, + "0/29/65528": [], + "0/29/65529": [], + "0/29/65531": [0, 1, 2, 3, 65532, 65533, 65528, 65529, 65531], + "0/31/0": [ + { + "1": 5, + "2": 2, + "3": [112233], + "4": null, + "254": 1 + } + ], + "0/31/1": [], + "0/31/2": 4, + "0/31/3": 3, + "0/31/4": 4, + "0/31/65532": 1, + "0/31/65533": 2, + "0/31/65528": [], + "0/31/65529": [], + "0/31/65531": [0, 1, 2, 3, 4, 65532, 65533, 65528, 65529, 65531], + "0/40/0": 19, + "0/40/1": "Mock", + "0/40/2": 65521, + "0/40/3": "Mock Cooktop", + "0/40/4": 32768, + "0/40/5": "", + "0/40/6": "**REDACTED**", + "0/40/7": 0, + "0/40/8": "TEST_VERSION", + "0/40/9": 1, + "0/40/10": "1.0", + "0/40/11": "20200101", + "0/40/12": "", + "0/40/13": "", + "0/40/14": "", + "0/40/15": "TEST_SN", + "0/40/16": false, + "0/40/17": true, + "0/40/18": "8854D258EF79CBAE", + "0/40/19": { + "0": 3, + "1": 65535 + }, + "0/40/21": 17104896, + "0/40/22": 1, + "0/40/24": 1, + "0/40/65532": 0, + "0/40/65533": 4, + "0/40/65528": [], + "0/40/65529": [], + "0/40/65531": [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, + 22, 24, 65532, 65533, 65528, 65529, 65531 + ], + "0/43/0": "en-US", + "0/43/1": [ + "en-US", + "de-DE", + "fr-FR", + "en-GB", + "es-ES", + "zh-CN", + "it-IT", + "ja-JP" + ], + "0/43/65532": 0, + "0/43/65533": 1, + "0/43/65528": [], + "0/43/65529": [], + "0/43/65531": [0, 1, 65532, 65533, 65528, 65529, 65531], + "0/45/0": 0, + "0/45/1": [0, 1, 2], + "0/45/65532": 1, + "0/45/65533": 2, + "0/45/65528": [], + "0/45/65529": [], + "0/45/65531": [0, 1, 65532, 65533, 65528, 65529, 65531], + "0/48/0": 0, + "0/48/1": { + "0": 60, + "1": 900 + }, + "0/48/2": 0, + "0/48/3": 2, + "0/48/4": true, + "0/48/65532": 0, + "0/48/65533": 2, + "0/48/65528": [1, 3, 5], + "0/48/65529": [0, 2, 4], + "0/48/65531": [0, 1, 2, 3, 4, 65532, 65533, 65528, 65529, 65531], + "0/49/0": 1, + "0/49/1": [ + { + "0": "ZW5zMzM=", + "1": true + } + ], + "0/49/4": true, + "0/49/5": null, + "0/49/6": null, + "0/49/7": null, + "0/49/65532": 4, + "0/49/65533": 2, + "0/49/65528": [], + "0/49/65529": [], + "0/49/65531": [0, 1, 4, 5, 6, 7, 65532, 65533, 65528, 65529, 65531], + "0/51/0": [ + { + "0": "docker0", + "1": false, + "2": null, + "3": null, + "4": "AkIN/v6b", + "5": ["rBEAAQ=="], + "6": [""], + "7": 0 + }, + { + "0": "ens33", + "1": true, + "2": null, + "3": null, + "4": "AAwp/F0T", + "5": ["wKgBqA=="], + "6": [ + "KgEOCgKzOZAP/YMcX0yMLQ==", + "KgEOCgKzOZC/O1Ew1WvS4A==", + "/oAAAAAAAADml3Ozl7GZug==" + ], + "7": 2 + }, + { + "0": "lo", + "1": true, + "2": null, + "3": null, + "4": "AAAAAAAA", + "5": ["fwAAAQ=="], + "6": ["AAAAAAAAAAAAAAAAAAAAAQ=="], + "7": 0 + } + ], + "0/51/1": 1, + "0/51/2": 23, + "0/51/3": 0, + "0/51/4": 0, + "0/51/5": [], + "0/51/6": [], + "0/51/7": [], + "0/51/8": false, + "0/51/65532": 0, + "0/51/65533": 2, + "0/51/65528": [2], + "0/51/65529": [0, 1], + "0/51/65531": [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 65532, 65533, 65528, 65529, 65531 + ], + "0/54/0": null, + "0/54/1": null, + "0/54/2": 3, + "0/54/3": null, + "0/54/4": null, + "0/54/5": null, + "0/54/6": null, + "0/54/7": null, + "0/54/8": null, + "0/54/9": null, + "0/54/10": null, + "0/54/11": null, + "0/54/12": null, + "0/54/65532": 3, + "0/54/65533": 1, + "0/54/65528": [], + "0/54/65529": [0], + "0/54/65531": [ + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 65532, 65533, 65528, 65529, + 65531 + ], + "0/60/0": 0, + "0/60/1": null, + "0/60/2": null, + "0/60/65532": 1, + "0/60/65533": 1, + "0/60/65528": [], + "0/60/65529": [0, 1, 2], + "0/60/65531": [0, 1, 2, 65532, 65533, 65528, 65529, 65531], + "0/62/0": [ + { + "1": "FTABAQEkAgE3AyQTAhgmBIAigScmBYAlTTo3BiQVAiQRAxgkBwEkCAEwCUEE1B4lA2AYRzpeBC9EizUv1FilsHNIEbFdH0c0o1NCiMMsdkxMJ/MnyXholb/76NUBLrq0tFMXYMa8TjIcHh915zcKNQEoARgkAgE2AwQCBAEYMAQUgfoxJi2HOriuKa6K2cbtp49/SYIwBRRqGquZZYwbDAaOinVVrS9sWTozoBgwC0DCxbisQiHwqDX9s2aGsCUz+6/8evG3EOMGOU0tG1DuXY4kd5TTxmIAjk51GwIszElOMBsfQV5ZAB1KbSKgaUrwGA==", + "2": "FTABAQEkAgE3AyQUARgmBIAigScmBYAlTTo3BiQTAhgkBwEkCAEwCUEEyvr+z4yBxEDoiyCFg+i408LqC3j0UMvTszBv1051g2EMrAzBkj+0RZFsSl3eQ3D2c7mTcH6GERtlk4BqGvC1qDcKNQEpARgkAmAwBBRqGquZZYwbDAaOinVVrS9sWTozoDAFFE+S8AxvAsS5t+ARMzsvuJx7MaUfGDALQCIuoikQZU9LkDKw7dcTVVXBDlTyBol3w070PIIw8BbaQD5qCeIv/3cI5/X5sAYTmemRq0ZPMjAw1dsN+wodzm8Y", + "254": 1 + } + ], + "0/62/1": [ + { + "1": "BIPshBqc9a7nNK00eRrviEzHfe/cfATY9VngqKv17+uAUpy3XujhZBjkAQyhYAaSKxVzSfVttY4FVQkpXIHZFlA=", + "2": 4939, + "3": 2, + "4": 3, + "5": "Maison", + "254": 1 + } + ], + "0/62/2": 16, + "0/62/3": 1, + "0/62/4": [ + "FTABAQEkAgE3AyQUARgmBIAigScmBYAlTTo3BiQUARgkBwEkCAEwCUEEg+yEGpz1ruc0rTR5Gu+ITMd979x8BNj1WeCoq/Xv64BSnLde6OFkGOQBDKFgBpIrFXNJ9W21jgVVCSlcgdkWUDcKNQEpARgkAmAwBBRPkvAMbwLEubfgETM7L7icezGlHzAFFE+S8AxvAsS5t+ARMzsvuJx7MaUfGDALQIKyooBXllxj1uo4Zn4CBbZqECNdO3wwzlhl7ZEygrWa04gBa5rVqgg+JahrvXD6HPHu4XldWIULtqTCPPIm4OsY" + ], + "0/62/5": 1, + "0/62/65532": 0, + "0/62/65533": 2, + "0/62/65528": [1, 3, 5, 8], + "0/62/65529": [0, 2, 4, 6, 7, 9, 10, 11], + "0/62/65531": [0, 1, 2, 3, 4, 5, 65532, 65533, 65528, 65529, 65531], + "0/63/0": [], + "0/63/1": [], + "0/63/2": 4, + "0/63/3": 3, + "0/63/65532": 0, + "0/63/65533": 2, + "0/63/65528": [2, 5], + "0/63/65529": [0, 1, 3, 4], + "0/63/65531": [0, 1, 2, 3, 65532, 65533, 65528, 65529, 65531], + "1/3/0": 0, + "1/3/1": 0, + "1/3/65532": 0, + "1/3/65533": 5, + "1/3/65528": [], + "1/3/65529": [0], + "1/3/65531": [0, 1, 65532, 65533, 65528, 65529, 65531], + "1/6/0": true, + "1/6/65532": 4, + "1/6/65533": 6, + "1/6/65528": [], + "1/6/65529": [0], + "1/6/65531": [0, 65532, 65533, 65528, 65529, 65531], + "1/29/0": [ + { + "0": 120, + "1": 1 + } + ], + "1/29/1": [3, 6, 29], + "1/29/2": [], + "1/29/3": [2], + "1/29/65532": 0, + "1/29/65533": 2, + "1/29/65528": [], + "1/29/65529": [], + "1/29/65531": [0, 1, 2, 3, 65532, 65533, 65528, 65529, 65531], + "2/6/0": true, + "2/6/65532": 4, + "2/6/65533": 6, + "2/6/65528": [], + "2/6/65529": [0], + "2/6/65531": [0, 65532, 65533, 65528, 65529, 65531], + "2/29/0": [ + { + "0": 119, + "1": 1 + } + ], + "2/29/1": [6, 29, 86, 1026], + "2/29/2": [], + "2/29/3": [], + "2/29/65532": 0, + "2/29/65533": 2, + "2/29/65528": [], + "2/29/65529": [], + "2/29/65531": [0, 1, 2, 3, 65532, 65533, 65528, 65529, 65531], + "2/86/4": 1, + "2/86/5": ["Low", "Medium", "High"], + "2/86/65532": 2, + "2/86/65533": 1, + "2/86/65528": [], + "2/86/65529": [0], + "2/86/65531": [4, 5, 65532, 65533, 65528, 65529, 65531], + "2/1026/0": 18000, + "2/1026/1": null, + "2/1026/2": null, + "2/1026/65532": 0, + "2/1026/65533": 4, + "2/1026/65528": [], + "2/1026/65529": [], + "2/1026/65531": [0, 1, 2, 65532, 65533, 65528, 65529, 65531] + }, + "attribute_subscriptions": [] +} diff --git a/tests/components/matter/snapshots/test_select.ambr b/tests/components/matter/snapshots/test_select.ambr index 5222dda1ab5..f4b86271a56 100644 --- a/tests/components/matter/snapshots/test_select.ambr +++ b/tests/components/matter/snapshots/test_select.ambr @@ -117,6 +117,64 @@ 'state': 'previous', }) # --- +# name: test_selects[cooktop][select.mock_cooktop_temperature_level-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'options': list([ + 'Low', + 'Medium', + 'High', + ]), + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'select', + 'entity_category': None, + 'entity_id': 'select.mock_cooktop_temperature_level', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Temperature level', + 'platform': 'matter', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'temperature_level', + 'unique_id': '00000000000004D2-0000000000000003-MatterNodeDevice-2-TemperatureControlSelectedTemperatureLevel-86-4', + 'unit_of_measurement': None, + }) +# --- +# name: test_selects[cooktop][select.mock_cooktop_temperature_level-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': 'Mock Cooktop Temperature level', + 'options': list([ + 'Low', + 'Medium', + 'High', + ]), + }), + 'context': , + 'entity_id': 'select.mock_cooktop_temperature_level', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'Medium', + }) +# --- # name: test_selects[dimmable_light][select.mock_dimmable_light_led_color-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ diff --git a/tests/components/matter/snapshots/test_sensor.ambr b/tests/components/matter/snapshots/test_sensor.ambr index 2c6ef8ad51b..550c9edd160 100644 --- a/tests/components/matter/snapshots/test_sensor.ambr +++ b/tests/components/matter/snapshots/test_sensor.ambr @@ -1219,6 +1219,58 @@ 'state': '189.0', }) # --- +# name: test_sensors[cooktop][sensor.mock_cooktop_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': None, + 'entity_id': 'sensor.mock_cooktop_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Temperature', + 'platform': 'matter', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '00000000000004D2-0000000000000003-MatterNodeDevice-2-TemperatureSensor-1026-0', + 'unit_of_measurement': , + }) +# --- +# name: test_sensors[cooktop][sensor.mock_cooktop_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'Mock Cooktop Temperature', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.mock_cooktop_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '180.0', + }) +# --- # name: test_sensors[eve_contact_sensor][sensor.eve_door_battery-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ diff --git a/tests/components/matter/snapshots/test_switch.ambr b/tests/components/matter/snapshots/test_switch.ambr index d60a2933e6f..f7d0b66c5f1 100644 --- a/tests/components/matter/snapshots/test_switch.ambr +++ b/tests/components/matter/snapshots/test_switch.ambr @@ -1,4 +1,100 @@ # serializer version: 1 +# name: test_switches[cooktop][switch.mock_cooktop_power_1-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.mock_cooktop_power_1', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Power (1)', + 'platform': 'matter', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'power', + 'unique_id': '00000000000004D2-0000000000000003-MatterNodeDevice-1-MatterPowerToggle-6-0', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[cooktop][switch.mock_cooktop_power_1-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'switch', + 'friendly_name': 'Mock Cooktop Power (1)', + }), + 'context': , + 'entity_id': 'switch.mock_cooktop_power_1', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_switches[cooktop][switch.mock_cooktop_power_2-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.mock_cooktop_power_2', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Power (2)', + 'platform': 'matter', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'power', + 'unique_id': '00000000000004D2-0000000000000003-MatterNodeDevice-2-MatterPowerToggle-6-0', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[cooktop][switch.mock_cooktop_power_2-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'switch', + 'friendly_name': 'Mock Cooktop Power (2)', + }), + 'context': , + 'entity_id': 'switch.mock_cooktop_power_2', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- # name: test_switches[door_lock][switch.mock_door_lock-entry] EntityRegistryEntrySnapshot({ 'aliases': set({