From d599a49ae49c5bd8bafecc20c52797cde5869409 Mon Sep 17 00:00:00 2001 From: Detailzc <138568377+Detailzc@users.noreply.github.com> Date: Fri, 1 Dec 2023 22:05:25 +0800 Subject: [PATCH] Reverse switch operation (#1090) Signed-off-by: WangShao --- .../zigbee-switch/src/test/test_wallhero_switch.lua | 4 ++-- drivers/SmartThings/zigbee-switch/src/wallhero/init.lua | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/SmartThings/zigbee-switch/src/test/test_wallhero_switch.lua b/drivers/SmartThings/zigbee-switch/src/test/test_wallhero_switch.lua index 2ef481af81..24bb33b10f 100644 --- a/drivers/SmartThings/zigbee-switch/src/test/test_wallhero_switch.lua +++ b/drivers/SmartThings/zigbee-switch/src/test/test_wallhero_switch.lua @@ -327,7 +327,7 @@ test.register_coroutine_test( "Handle turnOffIndicatorLight in infochanged : On", function() test.socket.device_lifecycle:__queue_receive(mock_parent_device:generate_info_changed({ - preferences = { ["stse.turnOffIndicatorLight"] = true } + preferences = { ["stse.turnOffIndicatorLight"] = false } })) test.socket.zigbee:__expect_send({ mock_parent_device.id, cluster_base.write_manufacturer_specific_attribute(mock_parent_device, 0x0006, @@ -339,7 +339,7 @@ test.register_coroutine_test( "Handle turnOffIndicatorLight in infochanged : Off", function() test.socket.device_lifecycle:__queue_receive(mock_parent_device:generate_info_changed({ - preferences = { ["stse.turnOffIndicatorLight"] = false } + preferences = { ["stse.turnOffIndicatorLight"] = true } })) test.socket.zigbee:__expect_send({ mock_parent_device.id, cluster_base.write_manufacturer_specific_attribute(mock_parent_device, 0x0006, diff --git a/drivers/SmartThings/zigbee-switch/src/wallhero/init.lua b/drivers/SmartThings/zigbee-switch/src/wallhero/init.lua index c96e89a16d..4d739fb136 100644 --- a/drivers/SmartThings/zigbee-switch/src/wallhero/init.lua +++ b/drivers/SmartThings/zigbee-switch/src/wallhero/init.lua @@ -102,7 +102,7 @@ end local function device_info_changed(driver, device, event, args) local preferences = device.preferences local old_preferences = args.old_st_store.preferences - local value_map = { [true] = 0x01,[false] = 0x00 } + local value_map = { [true] = 0x00,[false] = 0x01 } if preferences ~= nil then local id = "stse.turnOffIndicatorLight" local old_value = old_preferences[id]