@@ -39,7 +39,7 @@ local aqara_mock_device = test.mock_device.build_test_matter_device({
39
39
{cluster_id = clusters .Basic .ID , cluster_type = " SERVER" },
40
40
{cluster_id = clusters .ElectricalPowerMeasurement .ID , cluster_type = " SERVER" , cluster_revision = 1 , feature_map = 2 },
41
41
{cluster_id = clusters .ElectricalEnergyMeasurement .ID , cluster_type = " SERVER" , cluster_revision = 1 , feature_map = 5 },
42
- {cluster_id = clusters .PowerTopology .ID , cluster_type = " SERVER" , cluster_revision = 1 , feature_map = 2 } -- NODE_TOPOLOGY
42
+ {cluster_id = clusters .PowerTopology .ID , cluster_type = " SERVER" , cluster_revision = 1 , feature_map = 1 } -- NODE_TOPOLOGY
43
43
},
44
44
device_types = {
45
45
{device_type_id = 0x0016 , device_type_revision = 1 }, -- RootNode
@@ -178,11 +178,12 @@ local function test_init()
178
178
end
179
179
end
180
180
test .socket .matter :__expect_send ({aqara_mock_device .id , subscribe_request })
181
- aqara_mock_device :set_field (" __ELECTRICAL_TOPOLOGY" , {topology = clusters .PowerTopology .types .Feature .NODE_TOPOLOGY , tags_on_ep = {[1 ] = " -power-energy-powerConsumption" }}, {persist = false }) -- since we're assuming this would have happened during device_added in this case.
181
+
182
+ -- Test added -> doConfigure logic
183
+ test .socket .device_lifecycle :__queue_receive ({ aqara_mock_device .id , " added" })
184
+ test .socket .matter :__expect_send ({aqara_mock_device .id , subscribe_request })
182
185
test .socket .device_lifecycle :__queue_receive ({ aqara_mock_device .id , " doConfigure" })
183
- test .mock_devices_api ._expected_device_updates [aqara_mock_device .device_id ] = " 00000000-1111-2222-3333-000000000001"
184
- test .mock_devices_api ._expected_device_updates [1 ] = {device_id = " 00000000-1111-2222-3333-000000000001" }
185
- test .mock_devices_api ._expected_device_updates [1 ].metadata = {deviceId = " 00000000-1111-2222-3333-000000000001" , profileReference = " 4-button" }
186
+ aqara_mock_device :expect_metadata_update ({ profile = " 4-button" })
186
187
aqara_mock_device :expect_metadata_update ({ provisioning_state = " PROVISIONED" })
187
188
test .mock_device .add_test_device (aqara_mock_device )
188
189
-- to test powerConsumptionReport
0 commit comments