From 9942b52bd4029a52078094144188d00d0baba808 Mon Sep 17 00:00:00 2001 From: seojune Date: Thu, 18 Apr 2024 14:05:29 +0900 Subject: [PATCH 1/6] 1. add new error status event 2. fix abnormal feeding logs in history tab and life cycle issues --- drivers/Aqara/aqara-feeder/src/init.lua | 32 ++++++++++++------- .../src/test/test_aqara_pet_feeder.lua | 4 +-- 2 files changed, 21 insertions(+), 15 deletions(-) diff --git a/drivers/Aqara/aqara-feeder/src/init.lua b/drivers/Aqara/aqara-feeder/src/init.lua index a3af166fc9..fba75a42c2 100644 --- a/drivers/Aqara/aqara-feeder/src/init.lua +++ b/drivers/Aqara/aqara-feeder/src/init.lua @@ -17,7 +17,12 @@ local PRIVATE_CLUSTER_ID = 0xFCC0 local PRIVATE_ATTR_ID = 0xFFF1 local MFG_CODE = 0x115F -local callback_timer = function(driver, device, cmd) +local function reload_portion(device) + local lastPortion = device:get_latest_state("main", capabilities.feederPortion.ID, + capabilities.feederPortion.feedPortion.NAME) or 0 + device:emit_event(capabilities.feederPortion.feedPortion({ value = lastPortion, unit = "servings" })) +end +local callback_feed = function(device) return function() device:emit_event(capabilities.feederOperatingState.feederOperatingState("idle")) end @@ -64,10 +69,7 @@ end -- [[ capability_handlers ]] local function do_refresh(driver, device) -- refresh - local lastPortion = device:get_latest_state("main", capabilities.feederPortion.ID, - capabilities.feederPortion.feedPortion.NAME) or 0 - device:emit_event(capabilities.feederPortion.feedPortion({ value = lastPortion, unit = "servings" }, - { state_change = true })) + reload_portion(device) do_payload(device, 8, 0, 2001, OP_REPORT, 1, 0) device:emit_event(capabilities.feederOperatingState.feederOperatingState("idle")) end @@ -104,23 +106,25 @@ local function petFeeder_handler(driver, device, value, zb_rx) elseif funcID == "14.92.85" then -- feed portion device:emit_event(capabilities.feederPortion.feedPortion({ value = conv_data(param), unit = "servings" })) - elseif funcID == "13.104.85" then - local feed_source = device:get_field(FEED_SOURCE) + elseif funcID == "13.104.85" and conv_data(param) ~= 0 then + local feed_source = device:get_field(FEED_SOURCE) or 0 if feed_source == 0 then device:emit_event(capabilities.feederOperatingState.feederOperatingState("feeding")) end device:set_field(FEED_SOURCE, 0, { persist = true }) delete_timer(device) - device:set_field(FEED_TIMER, device.thread:call_with_delay(FEED_TIME, callback_timer(driver, device))) + device:set_field(FEED_TIMER, device.thread:call_with_delay(FEED_TIME, callback_feed(device))) + elseif funcID == "13.11.85" then + -- error + delete_timer(device) + local evt = "idle" + if conv_data(param) == 1 then evt = "error" end + device:emit_event(capabilities.feederOperatingState.feederOperatingState(evt)) end end -- [[ lifecycle_handlers ]] local function device_added(driver, device) - -- private protocol enable - device:send(cluster_base.write_manufacturer_specific_attribute(device, - PRIVATE_CLUSTER_ID, 0x0009, MFG_CODE, data_types.Uint8, 1)) - -- init do_payload(device, 4, 24, 85, OP_WRITE, 1, 0) device:emit_event(capabilities.feederOperatingState.feederOperatingState("idle")) device:emit_event(capabilities.feederPortion.feedPortion({ value = 1, unit = "servings" })) @@ -143,6 +147,10 @@ local function device_info_changed(driver, device, event, args) end local function device_configure(driver, device) + -- private protocol enable + device:send(cluster_base.write_manufacturer_specific_attribute(device, + PRIVATE_CLUSTER_ID, 0x0009, MFG_CODE, data_types.Uint8, 1)) + do_payload(device, 4, 24, 85, OP_WRITE, 1, 0) end -- [[ Registration ]] diff --git a/drivers/Aqara/aqara-feeder/src/test/test_aqara_pet_feeder.lua b/drivers/Aqara/aqara-feeder/src/test/test_aqara_pet_feeder.lua index 9b896584ab..93ac2392c1 100644 --- a/drivers/Aqara/aqara-feeder/src/test/test_aqara_pet_feeder.lua +++ b/drivers/Aqara/aqara-feeder/src/test/test_aqara_pet_feeder.lua @@ -51,8 +51,6 @@ test.register_coroutine_test( test.socket.zigbee:__set_channel_ordering("relaxed") test.socket.capability:__set_channel_ordering("relaxed") test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added" }) - test.socket.zigbee:__expect_send({ mock_device.id, - cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, 0x0009, MFG_CODE, data_types.Uint8, 1) }) test.socket.zigbee:__expect_send({ mock_device.id, cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.OctetString, "\x00\x02\x01\x04\x18\x00\x55\x01\x00") }) test.socket.capability:__expect_send(mock_device:generate_test_message("main", @@ -69,7 +67,7 @@ test.register_coroutine_test( function() test.socket.capability:__queue_receive({ mock_device.id, { capability = "refresh", component = "main", command = "refresh", args = {} } }) test.socket.capability:__expect_send(mock_device:generate_test_message("main", - capabilities.feederPortion.feedPortion({value=0, unit="servings"}, {state_change=true}))) + capabilities.feederPortion.feedPortion({value=0, unit="servings"}))) test.socket.zigbee:__expect_send({ mock_device.id, cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.OctetString, "\x00\x05\x01\x08\x00\x07\xD1\x01\x00") }) test.socket.capability:__expect_send(mock_device:generate_test_message("main", From 67be414a5a8d62ea2a600be43103347bde72c076 Mon Sep 17 00:00:00 2001 From: kiera-robinson Date: Wed, 17 Apr 2024 14:36:46 -0400 Subject: [PATCH 2/6] Addition of 'setSaturation' and 'setHue' logic for Philips Hue Lights --- .../SmartThings/philips-hue/src/handlers.lua | 36 +++++++++++++++++++ drivers/SmartThings/philips-hue/src/init.lua | 4 +++ 2 files changed, 40 insertions(+) diff --git a/drivers/SmartThings/philips-hue/src/handlers.lua b/drivers/SmartThings/philips-hue/src/handlers.lua index a4e950ae9a..6602057052 100644 --- a/drivers/SmartThings/philips-hue/src/handlers.lua +++ b/drivers/SmartThings/philips-hue/src/handlers.lua @@ -166,6 +166,28 @@ local function do_color_action(driver, device, args) end end +-- Function to allow changes to "setHue" attribute to Philips Hue light devices +---@param driver HueDriver +---@param device HueChildDevice +local function do_setHue_action(driver, device, args) + + -- Use existing 'saturation' value for device or set to 0 and pass arg values to function 'do_color_action' + local currentSaturation = device:get_latest_state("main", capabilities.colorControl.ID, capabilities.colorControl.saturation.NAME) or 0 + args.args.color.saturation = currentSaturation + do_color_action(driver, device, args) +end + +-- Function to allow changes to "setSaturation" attribute to Philips Hue light devices +---@param driver HueDriver +---@param device HueChildDevice +local function do_setSaturation_action(driver, device, args) + + -- Use existing 'hue' value for device or set to 0 and pass arg values to function 'do_color_action' + local currentHue = device:get_latest_state("main", capabilities.colorControl.ID, capabilities.colorControl.hue.NAME) or 0 + args.args.color.hue = currentHue + do_color_action(driver, device, args) +end + function handlers.kelvin_to_mirek(kelvin) return 1000000 / kelvin end function handlers.mirek_to_kelvin(mirek) return 1000000 / mirek end @@ -248,6 +270,20 @@ function handlers.set_color_temp_handler(driver, device, args) do_color_temp_action(driver, device, args) end +---@param driver HueDriver +---@param device HueChildDevice +function handlers.set_color_hue_handler(driver, device, args) + do_setHue_action(driver, device, args) +end + + +---@param driver HueDriver +---@param device HueChildDevice +function handlers.set_color_saturation_handler(driver, device, args) + do_setSaturation_action(driver, device, args) +end + + ---@param driver HueDriver ---@param light_device HueChildDevice ---@param conn_status_cache table|nil diff --git a/drivers/SmartThings/philips-hue/src/init.lua b/drivers/SmartThings/philips-hue/src/init.lua index b8cdf5cb4b..f5b45b7b36 100644 --- a/drivers/SmartThings/philips-hue/src/init.lua +++ b/drivers/SmartThings/philips-hue/src/init.lua @@ -70,6 +70,8 @@ local switch_on_handler = safe_wrap_handler(handlers.switch_on_handler) local switch_off_handler = safe_wrap_handler(handlers.switch_off_handler) local switch_level_handler = safe_wrap_handler(handlers.switch_level_handler) local set_color_handler = safe_wrap_handler(handlers.set_color_handler) +local set_color_hue_handler = safe_wrap_handler(handlers.set_color_hue_handler) +local set_color_saturation_handler = safe_wrap_handler(handlers.set_color_saturation_handler) local set_color_temp_handler = safe_wrap_handler(handlers.set_color_temp_handler) ---@param light_device HueChildDevice @@ -1509,6 +1511,8 @@ local hue = Driver("hue", }, [capabilities.colorControl.ID] = { [capabilities.colorControl.commands.setColor.NAME] = set_color_handler, + [capabilities.colorControl.commands.setHue.NAME] = set_color_hue_handler, + [capabilities.colorControl.commands.setSaturation.NAME] = set_color_saturation_handler, }, [capabilities.colorTemperature.ID] = { [capabilities.colorTemperature.commands.setColorTemperature.NAME] = set_color_temp_handler, From 72ed37f1cbe748ae558d8d9a7714276f4ff4bdf1 Mon Sep 17 00:00:00 2001 From: kiera-robinson Date: Wed, 24 Apr 2024 11:13:55 -0400 Subject: [PATCH 3/6] Fixed `args.args.color` to properly allow parsing of the `hue` and `saturation` values; minor variable name changes; included default value in the `get_latest_state` method call --- .../SmartThings/philips-hue/src/handlers.lua | 18 ++++++++++++------ drivers/SmartThings/philips-hue/src/init.lua | 8 ++++---- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/drivers/SmartThings/philips-hue/src/handlers.lua b/drivers/SmartThings/philips-hue/src/handlers.lua index 6602057052..c00f74c86e 100644 --- a/drivers/SmartThings/philips-hue/src/handlers.lua +++ b/drivers/SmartThings/philips-hue/src/handlers.lua @@ -172,8 +172,11 @@ end local function do_setHue_action(driver, device, args) -- Use existing 'saturation' value for device or set to 0 and pass arg values to function 'do_color_action' - local currentSaturation = device:get_latest_state("main", capabilities.colorControl.ID, capabilities.colorControl.saturation.NAME) or 0 - args.args.color.saturation = currentSaturation + local currentSaturation = device:get_latest_state("main", capabilities.colorControl.ID, capabilities.colorControl.saturation.NAME, 0) + args.args.color = { + hue = args.args.hue, + saturation = currentSaturation + } do_color_action(driver, device, args) end @@ -183,8 +186,11 @@ end local function do_setSaturation_action(driver, device, args) -- Use existing 'hue' value for device or set to 0 and pass arg values to function 'do_color_action' - local currentHue = device:get_latest_state("main", capabilities.colorControl.ID, capabilities.colorControl.hue.NAME) or 0 - args.args.color.hue = currentHue + local currentHue = device:get_latest_state("main", capabilities.colorControl.ID, capabilities.colorControl.hue.NAME, 0) + args.args.color = { + hue = currentHue, + saturation = args.args.saturation + } do_color_action(driver, device, args) end @@ -272,14 +278,14 @@ end ---@param driver HueDriver ---@param device HueChildDevice -function handlers.set_color_hue_handler(driver, device, args) +function handlers.set_hue_handler(driver, device, args) do_setHue_action(driver, device, args) end ---@param driver HueDriver ---@param device HueChildDevice -function handlers.set_color_saturation_handler(driver, device, args) +function handlers.set_saturation_handler(driver, device, args) do_setSaturation_action(driver, device, args) end diff --git a/drivers/SmartThings/philips-hue/src/init.lua b/drivers/SmartThings/philips-hue/src/init.lua index f5b45b7b36..fed7768d01 100644 --- a/drivers/SmartThings/philips-hue/src/init.lua +++ b/drivers/SmartThings/philips-hue/src/init.lua @@ -70,8 +70,8 @@ local switch_on_handler = safe_wrap_handler(handlers.switch_on_handler) local switch_off_handler = safe_wrap_handler(handlers.switch_off_handler) local switch_level_handler = safe_wrap_handler(handlers.switch_level_handler) local set_color_handler = safe_wrap_handler(handlers.set_color_handler) -local set_color_hue_handler = safe_wrap_handler(handlers.set_color_hue_handler) -local set_color_saturation_handler = safe_wrap_handler(handlers.set_color_saturation_handler) +local set_hue_handler = safe_wrap_handler(handlers.set_hue_handler) +local set_saturation_handler = safe_wrap_handler(handlers.set_saturation_handler) local set_color_temp_handler = safe_wrap_handler(handlers.set_color_temp_handler) ---@param light_device HueChildDevice @@ -1511,8 +1511,8 @@ local hue = Driver("hue", }, [capabilities.colorControl.ID] = { [capabilities.colorControl.commands.setColor.NAME] = set_color_handler, - [capabilities.colorControl.commands.setHue.NAME] = set_color_hue_handler, - [capabilities.colorControl.commands.setSaturation.NAME] = set_color_saturation_handler, + [capabilities.colorControl.commands.setHue.NAME] = set_hue_handler, + [capabilities.colorControl.commands.setSaturation.NAME] = set_saturation_handler, }, [capabilities.colorTemperature.ID] = { [capabilities.colorTemperature.commands.setColorTemperature.NAME] = set_color_temp_handler, From 2f9f69d61ffe34bce1d9f5cef7fe7c31b0078540 Mon Sep 17 00:00:00 2001 From: Krik JIN Date: Wed, 10 Apr 2024 09:13:24 +0800 Subject: [PATCH 4/6] fix issue that Aqara Smart Plug T1 doesn't work after reonboarding This is a fix for re-onboarding scenario: STSE-2617 --- drivers/SmartThings/zigbee-switch/src/aqara/init.lua | 4 ++-- .../zigbee-switch/src/test/test_aqara_smart_plug.lua | 7 ------- .../zigbee-switch/src/test/test_aqara_smart_plug_t1.lua | 7 ------- .../zigbee-switch/src/test/test_aqara_switch_module.lua | 8 -------- 4 files changed, 2 insertions(+), 24 deletions(-) diff --git a/drivers/SmartThings/zigbee-switch/src/aqara/init.lua b/drivers/SmartThings/zigbee-switch/src/aqara/init.lua index b1a91da6a8..7e49b2b395 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara/init.lua @@ -142,6 +142,8 @@ local function private_mode_handler(driver, device, value, zb_rx) device:set_field(PRIVATE_MODE, value.value, { persist = true }) if value.value ~= 1 then + device:send(cluster_base.write_manufacturer_specific_attribute(device, + PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 0x01)) -- private device:send(SimpleMetering.attributes.CurrentSummationDelivered:configure_reporting(device, 900, 3600, 1)) -- minimal interval : 15min device:set_field(constants.ELECTRICAL_MEASUREMENT_DIVISOR_KEY, 10, { persist = true }) device:set_field(constants.SIMPLE_METERING_DIVISOR_KEY, 1000, { persist = true }) @@ -225,8 +227,6 @@ local function device_added(driver, device) device:emit_event(capabilities.powerMeter.power({ value = 0.0, unit = "W" })) device:emit_event(capabilities.energyMeter.energy({ value = 0.0, unit = "Wh" })) - device:send(cluster_base.write_manufacturer_specific_attribute(device, - PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 0x01)) -- private end local aqara_switch_handler = { diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug.lua index 0cc7e663f6..1388994d7f 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug.lua @@ -87,13 +87,6 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.energyMeter.energy({ value = 0.0, unit = "Wh" })) ) - test.socket.zigbee:__expect_send( - { - mock_device.id, - cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID - , MFG_CODE, data_types.Uint8, 1) - } - ) end ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug_t1.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug_t1.lua index d8c8383ca3..67464099cd 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug_t1.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_smart_plug_t1.lua @@ -88,13 +88,6 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.energyMeter.energy({ value = 0.0, unit = "Wh" })) ) - test.socket.zigbee:__expect_send( - { - mock_device.id, - cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID - , MFG_CODE, data_types.Uint8, 1) - } - ) end ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module.lua index 3d9c9ccfe5..d891030fd3 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_switch_module.lua @@ -26,7 +26,6 @@ local AnalogInput = clusters.AnalogInput local MFG_CODE = 0x115F local PRIVATE_CLUSTER_ID = 0xFCC0 -local PRIVATE_ATTRIBUTE_ID = 0x0009 local RESTORE_POWER_STATE_ATTRIBUTE_ID = 0x0201 local ELECTRIC_SWITCH_TYPE_ATTRIBUTE_ID = 0x000A @@ -68,13 +67,6 @@ test.register_coroutine_test( test.socket.capability:__expect_send( mock_device:generate_test_message("main", capabilities.energyMeter.energy({ value = 0.0, unit = "Wh" })) ) - test.socket.zigbee:__expect_send( - { - mock_device.id, - cluster_base.write_manufacturer_specific_attribute(mock_device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID - , MFG_CODE, data_types.Uint8, 1) - } - ) end ) From 2e364ace510b6dde32d7e8d7a89a6f2bff8a41df Mon Sep 17 00:00:00 2001 From: lelandblue <79465613+lelandblue@users.noreply.github.com> Date: Thu, 25 Apr 2024 15:35:55 -0400 Subject: [PATCH 5/6] New Device Linkind Smart Light Bulb A60 --- drivers/SmartThings/matter-switch/fingerprints.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/SmartThings/matter-switch/fingerprints.yml b/drivers/SmartThings/matter-switch/fingerprints.yml index 024bf6c8a6..c0f58df2b4 100644 --- a/drivers/SmartThings/matter-switch/fingerprints.yml +++ b/drivers/SmartThings/matter-switch/fingerprints.yml @@ -273,7 +273,11 @@ matterManufacturer: vendorId: 0x1168 productId: 0x03f8 deviceProfileName: light-color-level-1800K-6500K - + - id: "4456/1011" + deviceLabel: Smart Light Bulb A60 + vendorId: 0x1168 + productId: 0x03F3 + deviceProfileName: light-color-level-1800K-6500K #WiZ - id: "WiZ A19" deviceLabel: WiZ A19 From a55e3932184a9f2e2cd0f48844ef81cbfc50e6a7 Mon Sep 17 00:00:00 2001 From: zhoujie2022 <105092174+zhoujie2022@users.noreply.github.com> Date: Sat, 27 Apr 2024 06:02:43 +0800 Subject: [PATCH 6/6] fix Aqara LED Light Bult T1 reonboarding issue (#1308) reference: STSE-2616 Signed-off-by: zhoujie --- .../zigbee-switch/src/aqara-light/init.lua | 9 +++------ .../zigbee-switch/src/test/test_aqara_led_bulb.lua | 14 +++----------- .../zigbee-switch/src/test/test_aqara_light.lua | 14 +++----------- 3 files changed, 9 insertions(+), 28 deletions(-) diff --git a/drivers/SmartThings/zigbee-switch/src/aqara-light/init.lua b/drivers/SmartThings/zigbee-switch/src/aqara-light/init.lua index a264b26018..7225246299 100644 --- a/drivers/SmartThings/zigbee-switch/src/aqara-light/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/aqara-light/init.lua @@ -33,17 +33,15 @@ local function do_refresh(self, device) end local function do_configure(self, device) - device:send(ColorControl.commands.MoveToColorTemperature(device, 200, 0x0000)) device:configure() - do_refresh(self, device) -end - -local function device_added(driver, device, event) device:send(cluster_base.write_manufacturer_specific_attribute(device, PRIVATE_CLUSTER_ID, PRIVATE_ATTRIBUTE_ID, MFG_CODE, data_types.Uint8, 1)) -- private device:send(Level.attributes.OnTransitionTime:write(device, 0)) device:send(Level.attributes.OffTransitionTime:write(device, 0)) + device:send(ColorControl.commands.MoveToColorTemperature(device, 200, 0x0000)) + + do_refresh(self, device) end local function set_level_handler(driver, device, cmd) @@ -56,7 +54,6 @@ end local aqara_light_handler = { NAME = "Aqara Light Handler", lifecycle_handlers = { - added = device_added, doConfigure = do_configure }, capability_handlers = { diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_led_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_led_bulb.lua index 86c8d63058..f3b86453dd 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_led_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_led_bulb.lua @@ -53,9 +53,10 @@ end test.set_test_init_function(test_init) test.register_coroutine_test( - "Handle added lifecycle", + "Configure should configure all necessary attributes and refresh device", function() - test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added" }) + test.socket.device_lifecycle:__queue_receive({ mock_device.id, "doConfigure" }) + test.socket.zigbee:__set_channel_ordering("relaxed") test.socket.zigbee:__expect_send( { @@ -66,15 +67,6 @@ test.register_coroutine_test( ) test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.OnTransitionTime:write(mock_device, 0) }) test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.OffTransitionTime:write(mock_device, 0) }) - end -) - -test.register_coroutine_test( - "Configure should configure all necessary attributes and refresh device", - function() - test.socket.device_lifecycle:__queue_receive({ mock_device.id, "doConfigure" }) - test.socket.zigbee:__set_channel_ordering("relaxed") - test.socket.zigbee:__expect_send( { mock_device.id, diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_light.lua b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_light.lua index 0a6b63fbda..a9517ab626 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_aqara_light.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_aqara_light.lua @@ -54,9 +54,10 @@ end test.set_test_init_function(test_init) test.register_coroutine_test( - "Handle added lifecycle", + "Configure should configure all necessary attributes and refresh device", function() - test.socket.device_lifecycle:__queue_receive({ mock_device.id, "added" }) + test.socket.device_lifecycle:__queue_receive({ mock_device.id, "doConfigure" }) + test.socket.zigbee:__set_channel_ordering("relaxed") test.socket.zigbee:__expect_send( { @@ -67,15 +68,6 @@ test.register_coroutine_test( ) test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.OnTransitionTime:write(mock_device, 0) }) test.socket.zigbee:__expect_send({ mock_device.id, Level.attributes.OffTransitionTime:write(mock_device, 0) }) - end -) - -test.register_coroutine_test( - "Configure should configure all necessary attributes and refresh device", - function() - test.socket.device_lifecycle:__queue_receive({ mock_device.id, "doConfigure" }) - test.socket.zigbee:__set_channel_ordering("relaxed") - test.socket.zigbee:__expect_send( { mock_device.id,