Skip to content

Commit

Permalink
fix: Fix wrong iterator usage
Browse files Browse the repository at this point in the history
Using `ipairs` here instead of `pairs` meant that any devices
that ended up in this queue were never actually being refreshed.

Fixes #1674
  • Loading branch information
dljsjr committed Dec 19, 2024
1 parent 6da8004 commit 7cdc617
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7cdc617

Please sign in to comment.