fix ThrottleInit (3)

This commit is contained in:
2026-06-25 06:26:34 -05:00
parent e1e996e50f
commit 1d690c6087

View File

@@ -133,7 +133,6 @@ Throttles = {
} }
function ThrottleInit() function ThrottleInit()
Throttles = {}
local sides = { local sides = {
"top", "top",
@@ -177,9 +176,9 @@ function ThrottleInit()
while true do while true do
local currentStates = getRelayStates() local currentStates = getRelayStates()
for pname, currentState in pairs(currentStates) do for pname, currentState in ipairs(currentStates) do
local initialState = initialStates[pname] local initialState = initialStates[pname]
for k, v in pairs(currentState) do for k, v in ipairs(currentState) do
if initialState[k] ~= v then if initialState[k] ~= v then
Throttles.ForeThrottle.name = pname Throttles.ForeThrottle.name = pname
Throttles.ForeThrottle.side = k Throttles.ForeThrottle.side = k
@@ -197,11 +196,11 @@ function ThrottleInit()
while true do while true do
local currentStates = getRelayStates() local currentStates = getRelayStates()
for pname, currentState in pairs(currentStates) do for pname, currentState in ipairs(currentStates) do
local initialState = initialStates[pname] local initialState = initialStates[pname]
for k, v in pairs(currentState) do for k, v in ipairs(currentState) do
if initialState[k] ~= v then if initialState[k] ~= v then
Throttles.AftThrottleThrottle.name = pname Throttles.AftThrottle.name = pname
Throttles.AftThrottle.side = k Throttles.AftThrottle.side = k
return return
end end
@@ -217,9 +216,9 @@ function ThrottleInit()
while true do while true do
local currentStates = getRelayStates() local currentStates = getRelayStates()
for pname, currentState in pairs(currentStates) do for pname, currentState in ipairs(currentStates) do
local initialState = initialStates[pname] local initialState = initialStates[pname]
for k, v in pairs(currentState) do for k, v in ipairs(currentState) do
if initialState[k] ~= v then if initialState[k] ~= v then
Throttles.DownThrottle.name = pname Throttles.DownThrottle.name = pname
Throttles.DownThrottle.side = k Throttles.DownThrottle.side = k