From e4cc7a4d54608b6dbedf70f6342eaf9e193fb3bd Mon Sep 17 00:00:00 2001 From: Doug Stephen Date: Wed, 18 Dec 2024 15:47:14 -0600 Subject: [PATCH] fix: Fix wrong iterator usage Using `ipairs` here instead of `pairs` meant that any devices that ended up in this queue were never actually being refreshed. Fixes #1674 --- drivers/SmartThings/philips-hue/src/utils/hue_bridge_utils.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/SmartThings/philips-hue/src/utils/hue_bridge_utils.lua b/drivers/SmartThings/philips-hue/src/utils/hue_bridge_utils.lua index a1e7779bdd..ea67abea13 100644 --- a/drivers/SmartThings/philips-hue/src/utils/hue_bridge_utils.lua +++ b/drivers/SmartThings/philips-hue/src/utils/hue_bridge_utils.lua @@ -237,7 +237,7 @@ function hue_bridge_utils.do_bridge_network_init(driver, bridge_device, bridge_u end bridge_device:set_field(Fields._INIT, true, { persist = false }) local ids_to_remove = {} - for id, device in ipairs(driver._devices_pending_refresh) do + for id, device in pairs(driver._devices_pending_refresh) do local parent_bridge = utils.get_hue_bridge_for_device(driver, device) local bridge_id = parent_bridge and parent_bridge.id if bridge_id == bridge_device.id then