@@ -423,10 +423,155 @@ test.register_coroutine_test(
423423 mock_device :expect_metadata_update ({ provisioning_state = " PROVISIONED" })
424424 end ,
425425 {
426- min_api_version = 17
426+ min_api_version = 17 ,
427+ max_api_version = 19
427428 }
428429)
429430
431+ test .register_coroutine_test (
432+ " lifecycle configure event should configure device" ,
433+ function ()
434+ test .socket .zigbee :__set_channel_ordering (" relaxed" )
435+ test .socket .device_lifecycle :__queue_receive ({mock_device .id , " doConfigure" })
436+
437+ test .socket .zigbee :__expect_send ({ mock_device .id , ColorControl .attributes .ColorTempPhysicalMaxMireds :read (mock_device ) })
438+ test .socket .zigbee :__expect_send ({ mock_device .id , ColorControl .attributes .ColorTempPhysicalMinMireds :read (mock_device ) })
439+
440+ test .socket .zigbee :__expect_send ({
441+ mock_device .id ,
442+ OnOff .attributes .OnOff :read (mock_device )
443+ })
444+ test .socket .zigbee :__expect_send ({
445+ mock_device .id ,
446+ Level .attributes .CurrentLevel :read (mock_device )
447+ })
448+ test .socket .zigbee :__expect_send ({
449+ mock_device .id ,
450+ ColorControl .attributes .ColorTemperatureMireds :read (mock_device )
451+ })
452+ test .socket .zigbee :__expect_send ({
453+ mock_device .id ,
454+ ColorControl .attributes .CurrentHue :read (mock_device )
455+ })
456+ test .socket .zigbee :__expect_send ({
457+ mock_device .id ,
458+ ColorControl .attributes .CurrentSaturation :read (mock_device )
459+ })
460+ test .socket .zigbee :__expect_send ({
461+ mock_device .id ,
462+ zigbee_test_utils .build_bind_request (mock_device ,
463+ zigbee_test_utils .mock_hub_eui ,
464+ OnOff .ID )
465+ })
466+ test .socket .zigbee :__expect_send ({
467+ mock_device .id ,
468+ SimpleMetering .attributes .InstantaneousDemand :read (mock_device )
469+ })
470+ test .socket .zigbee :__expect_send ({
471+ mock_device .id ,
472+ SimpleMetering .attributes .CurrentSummationDelivered :read (mock_device )
473+ })
474+ test .socket .zigbee :__expect_send ({
475+ mock_device .id ,
476+ ElectricalMeasurement .attributes .ActivePower :read (mock_device )
477+ })
478+ test .socket .zigbee :__expect_send ({
479+ mock_device .id ,
480+ OnOff .attributes .OnOff :configure_reporting (mock_device , 0 , 300 )
481+ })
482+ test .socket .zigbee :__expect_send ({
483+ mock_device .id ,
484+ zigbee_test_utils .build_bind_request (mock_device ,
485+ zigbee_test_utils .mock_hub_eui ,
486+ Level .ID )
487+ })
488+ test .socket .zigbee :__expect_send ({
489+ mock_device .id ,
490+ Level .attributes .CurrentLevel :configure_reporting (mock_device , 1 , 3600 , 1 )
491+ })
492+ test .socket .zigbee :__expect_send ({
493+ mock_device .id ,
494+ zigbee_test_utils .build_bind_request (mock_device ,
495+ zigbee_test_utils .mock_hub_eui ,
496+ ColorControl .ID )
497+ })
498+ test .socket .zigbee :__expect_send ({
499+ mock_device .id ,
500+ ColorControl .attributes .ColorTemperatureMireds :configure_reporting (mock_device , 1 , 3600 , 0x0010 )
501+ })
502+ test .socket .zigbee :__expect_send ({
503+ mock_device .id ,
504+ ColorControl .attributes .CurrentHue :configure_reporting (mock_device , 1 , 3600 , 0x0010 )
505+ })
506+ test .socket .zigbee :__expect_send ({
507+ mock_device .id ,
508+ ColorControl .attributes .CurrentSaturation :configure_reporting (mock_device , 1 , 3600 , 0x0010 )
509+ })
510+ test .socket .zigbee :__expect_send ({
511+ mock_device .id ,
512+ ColorControl .attributes .ColorTempPhysicalMaxMireds :configure_reporting (mock_device , 1 , 43200 , 1 )
513+ })
514+ test .socket .zigbee :__expect_send ({
515+ mock_device .id ,
516+ ColorControl .attributes .ColorTempPhysicalMinMireds :configure_reporting (mock_device , 1 , 43200 , 1 )
517+ })
518+ test .socket .zigbee :__expect_send ({
519+ mock_device .id ,
520+ zigbee_test_utils .build_bind_request (mock_device ,
521+ zigbee_test_utils .mock_hub_eui ,
522+ SimpleMetering .ID )
523+ })
524+ test .socket .zigbee :__expect_send ({
525+ mock_device .id ,
526+ SimpleMetering .attributes .InstantaneousDemand :configure_reporting (mock_device , 5 , 3600 , 5 )
527+ })
528+ test .socket .zigbee :__expect_send ({
529+ mock_device .id ,
530+ SimpleMetering .attributes .CurrentSummationDelivered :configure_reporting (mock_device , 5 , 3600 , 1 )
531+ })
532+ test .socket .zigbee :__expect_send ({
533+ mock_device .id ,
534+ zigbee_test_utils .build_bind_request (mock_device ,
535+ zigbee_test_utils .mock_hub_eui ,
536+ ElectricalMeasurement .ID )
537+ })
538+ test .socket .zigbee :__expect_send ({
539+ mock_device .id ,
540+ ElectricalMeasurement .attributes .ActivePower :configure_reporting (mock_device , 5 , 3600 , 5 )
541+ })
542+ test .socket .zigbee :__expect_send ({
543+ mock_device .id ,
544+ ElectricalMeasurement .attributes .ACPowerMultiplier :configure_reporting (mock_device , 1 , 43200 , 1 )
545+ })
546+ test .socket .zigbee :__expect_send ({
547+ mock_device .id ,
548+ ElectricalMeasurement .attributes .ACPowerDivisor :configure_reporting (mock_device , 1 , 43200 , 1 )
549+ })
550+ test .socket .zigbee :__expect_send ({
551+ mock_device .id ,
552+ ElectricalMeasurement .attributes .ACPowerDivisor :read (mock_device )
553+ })
554+ test .socket .zigbee :__expect_send ({
555+ mock_device .id ,
556+ ElectricalMeasurement .attributes .ACPowerMultiplier :read (mock_device )
557+ })
558+ test .socket .zigbee :__expect_send ({
559+ mock_device .id ,
560+ SimpleMetering .attributes .Multiplier :read (mock_device )
561+ })
562+ test .socket .zigbee :__expect_send ({
563+ mock_device .id ,
564+ SimpleMetering .attributes .Divisor :read (mock_device )
565+ })
566+ test .socket .zigbee :__expect_send ({ mock_device .id , ColorControl .attributes .ColorTempPhysicalMaxMireds :read (mock_device ) })
567+ test .socket .zigbee :__expect_send ({ mock_device .id , ColorControl .attributes .ColorTempPhysicalMinMireds :read (mock_device ) })
568+
569+ mock_device :expect_metadata_update ({ provisioning_state = " PROVISIONED" })
570+ end ,
571+ {
572+ min_api_version = 20
573+ }
574+ )
430575-- test.register_coroutine_test(
431576-- "health check coroutine",
432577-- function()
0 commit comments