From 13c64b210b78edd9c527ae038147eff6366c2d07 Mon Sep 17 00:00:00 2001 From: cjswedes Date: Thu, 12 Feb 2026 13:10:33 -0600 Subject: [PATCH] Fixup tests for new native handlers in 60 --- .../src/test/test_all_capability_zigbee_bulb.lua | 16 ++++++++++++++++ .../zigbee-switch/src/test/test_zll_rgb_bulb.lua | 2 ++ .../src/test/test_generic_sensor.lua | 8 ++++++++ 3 files changed, 26 insertions(+) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_all_capability_zigbee_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_all_capability_zigbee_bulb.lua index 70dfc96780..b581c5c61e 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_all_capability_zigbee_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_all_capability_zigbee_bulb.lua @@ -233,6 +233,14 @@ test.register_message_test( channel = "capability", direction = "send", message = mock_device:generate_test_message("main", capabilities.colorControl.hue(0)) + }, + { + channel = "devices", + direction = "send", + message = { + "register_native_capability_attr_handler", + { device_uuid = mock_device.id, capability_id = "colorControl", capability_attr_id = "hue" } + } } } ) @@ -250,6 +258,14 @@ test.register_message_test( channel = "capability", direction = "send", message = mock_device:generate_test_message("main", capabilities.colorControl.saturation(50)) + }, + { + channel = "devices", + direction = "send", + message = { + "register_native_capability_attr_handler", + { device_uuid = mock_device.id, capability_id = "colorControl", capability_attr_id = "saturation" } + } } } ) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgb_bulb.lua b/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgb_bulb.lua index 3435b22288..a8384d1b13 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgb_bulb.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_zll_rgb_bulb.lua @@ -205,6 +205,7 @@ for _, data in ipairs(test_data) do if data.saturation ~= nil then test.socket.zigbee:__queue_receive({mock_device.id, ColorControl.attributes.CurrentSaturation:build_test_attr_report(mock_device, math.ceil(data.saturation / 100 * 0xFE))}) test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.colorControl.saturation(data.saturation))) + mock_device:expect_native_attr_handler_registration("colorControl", "saturation") end test.timer.__create_and_queue_test_time_advance_timer(0.2, "oneshot") @@ -249,6 +250,7 @@ for _, data in ipairs(test_data) do if data.hue ~= nil then test.socket.zigbee:__queue_receive({mock_device.id, ColorControl.attributes.CurrentHue:build_test_attr_report(mock_device, math.ceil(data.hue / 100 * 0xFE))}) test.socket.capability:__expect_send(mock_device:generate_test_message("main", capabilities.colorControl.hue(data.hue))) + mock_device:expect_native_attr_handler_registration("colorControl", "hue") end test.timer.__create_and_queue_test_time_advance_timer(0.2, "oneshot") diff --git a/drivers/SmartThings/zwave-sensor/src/test/test_generic_sensor.lua b/drivers/SmartThings/zwave-sensor/src/test/test_generic_sensor.lua index 643c69dd1f..e6fff57b0d 100644 --- a/drivers/SmartThings/zwave-sensor/src/test/test_generic_sensor.lua +++ b/drivers/SmartThings/zwave-sensor/src/test/test_generic_sensor.lua @@ -1548,6 +1548,14 @@ test.register_message_test( mock_device, Meter:Get({scale = 0}) ) + }, + { + channel = "zwave", + direction = "send", + message = zw_test_utils.zwave_test_build_send_command( + mock_device, + Meter:Get({scale = 4}) + ) } }, {