@@ -294,6 +294,140 @@ test.register_message_test(
294294 }
295295)
296296
297+ test .register_coroutine_test (
298+ " lifecycle configure event should configure device" ,
299+ function ()
300+ test .socket .zigbee :__set_channel_ordering (" relaxed" )
301+ test .socket .device_lifecycle :__queue_receive ({mock_device .id , " doConfigure" })
302+ test .socket .zigbee :__expect_send ({
303+ mock_device .id ,
304+ OnOff .attributes .OnOff :read (mock_device )
305+ })
306+ test .socket .zigbee :__expect_send ({
307+ mock_device .id ,
308+ Level .attributes .CurrentLevel :read (mock_device )
309+ })
310+ test .socket .zigbee :__expect_send ({
311+ mock_device .id ,
312+ ColorControl .attributes .ColorTemperatureMireds :read (mock_device )
313+ })
314+ test .socket .zigbee :__expect_send ({
315+ mock_device .id ,
316+ ColorControl .attributes .CurrentHue :read (mock_device )
317+ })
318+ test .socket .zigbee :__expect_send ({
319+ mock_device .id ,
320+ ColorControl .attributes .CurrentSaturation :read (mock_device )
321+ })
322+ test .socket .zigbee :__expect_send ({
323+ mock_device .id ,
324+ zigbee_test_utils .build_bind_request (mock_device ,
325+ zigbee_test_utils .mock_hub_eui ,
326+ OnOff .ID )
327+ })
328+ test .socket .zigbee :__expect_send ({
329+ mock_device .id ,
330+ SimpleMetering .attributes .InstantaneousDemand :read (mock_device )
331+ })
332+ test .socket .zigbee :__expect_send ({
333+ mock_device .id ,
334+ SimpleMetering .attributes .CurrentSummationDelivered :read (mock_device )
335+ })
336+ test .socket .zigbee :__expect_send ({
337+ mock_device .id ,
338+ ElectricalMeasurement .attributes .ActivePower :read (mock_device )
339+ })
340+ test .socket .zigbee :__expect_send ({
341+ mock_device .id ,
342+ OnOff .attributes .OnOff :configure_reporting (mock_device , 0 , 300 )
343+ })
344+ test .socket .zigbee :__expect_send ({
345+ mock_device .id ,
346+ zigbee_test_utils .build_bind_request (mock_device ,
347+ zigbee_test_utils .mock_hub_eui ,
348+ Level .ID )
349+ })
350+ test .socket .zigbee :__expect_send ({
351+ mock_device .id ,
352+ Level .attributes .CurrentLevel :configure_reporting (mock_device , 1 , 3600 , 1 )
353+ })
354+ test .socket .zigbee :__expect_send ({
355+ mock_device .id ,
356+ zigbee_test_utils .build_bind_request (mock_device ,
357+ zigbee_test_utils .mock_hub_eui ,
358+ ColorControl .ID )
359+ })
360+ test .socket .zigbee :__expect_send ({
361+ mock_device .id ,
362+ ColorControl .attributes .ColorTemperatureMireds :configure_reporting (mock_device , 1 , 3600 , 0x0010 )
363+ })
364+ test .socket .zigbee :__expect_send ({
365+ mock_device .id ,
366+ ColorControl .attributes .CurrentHue :configure_reporting (mock_device , 1 , 3600 , 0x0010 )
367+ })
368+ test .socket .zigbee :__expect_send ({
369+ mock_device .id ,
370+ ColorControl .attributes .CurrentSaturation :configure_reporting (mock_device , 1 , 3600 , 0x0010 )
371+ })
372+ test .socket .zigbee :__expect_send ({
373+ mock_device .id ,
374+ zigbee_test_utils .build_bind_request (mock_device ,
375+ zigbee_test_utils .mock_hub_eui ,
376+ SimpleMetering .ID )
377+ })
378+ test .socket .zigbee :__expect_send ({
379+ mock_device .id ,
380+ SimpleMetering .attributes .InstantaneousDemand :configure_reporting (mock_device , 5 , 3600 , 5 )
381+ })
382+ test .socket .zigbee :__expect_send ({
383+ mock_device .id ,
384+ SimpleMetering .attributes .CurrentSummationDelivered :configure_reporting (mock_device , 5 , 3600 , 1 )
385+ })
386+ test .socket .zigbee :__expect_send ({
387+ mock_device .id ,
388+ zigbee_test_utils .build_bind_request (mock_device ,
389+ zigbee_test_utils .mock_hub_eui ,
390+ ElectricalMeasurement .ID )
391+ })
392+ test .socket .zigbee :__expect_send ({
393+ mock_device .id ,
394+ ElectricalMeasurement .attributes .ActivePower :configure_reporting (mock_device , 5 , 3600 , 5 )
395+ })
396+ test .socket .zigbee :__expect_send ({
397+ mock_device .id ,
398+ ElectricalMeasurement .attributes .ACPowerMultiplier :configure_reporting (mock_device , 1 , 43200 , 1 )
399+ })
400+ test .socket .zigbee :__expect_send ({
401+ mock_device .id ,
402+ ElectricalMeasurement .attributes .ACPowerDivisor :configure_reporting (mock_device , 1 , 43200 , 1 )
403+ })
404+ test .socket .zigbee :__expect_send ({
405+ mock_device .id ,
406+ ElectricalMeasurement .attributes .ACPowerDivisor :read (mock_device )
407+ })
408+ test .socket .zigbee :__expect_send ({
409+ mock_device .id ,
410+ ElectricalMeasurement .attributes .ACPowerMultiplier :read (mock_device )
411+ })
412+ test .socket .zigbee :__expect_send ({
413+ mock_device .id ,
414+ SimpleMetering .attributes .Multiplier :read (mock_device )
415+ })
416+ test .socket .zigbee :__expect_send ({
417+ mock_device .id ,
418+ SimpleMetering .attributes .Divisor :read (mock_device )
419+ })
420+ test .socket .zigbee :__expect_send ({ mock_device .id , ColorControl .attributes .ColorTempPhysicalMaxMireds :read (mock_device ) })
421+ test .socket .zigbee :__expect_send ({ mock_device .id , ColorControl .attributes .ColorTempPhysicalMinMireds :read (mock_device ) })
422+
423+ mock_device :expect_metadata_update ({ provisioning_state = " PROVISIONED" })
424+ end ,
425+ {
426+ min_api_version = 17 ,
427+ max_api_version = 19
428+ }
429+ )
430+
297431test .register_coroutine_test (
298432 " lifecycle configure event should configure device" ,
299433 function ()
@@ -435,10 +569,9 @@ test.register_coroutine_test(
435569 mock_device :expect_metadata_update ({ provisioning_state = " PROVISIONED" })
436570 end ,
437571 {
438- min_api_version = 17
572+ min_api_version = 20
439573 }
440574)
441-
442575-- test.register_coroutine_test(
443576-- "health check coroutine",
444577-- function()
0 commit comments