Skip to content

Commit

Permalink
Merge pull request #154 from ItsMeGoo/master
Browse files Browse the repository at this point in the history
Fix Wireless EU for 2.6+
  • Loading branch information
S4mpsa authored Oct 6, 2024
2 parents f835542 + 127fc0a commit ad244df
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions server/usecases/get-lsc-status.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ local function exec(address, name, location)
problems = getNumberOfProblems(sensorInformation[9])
end


local state = nil
if lsc:isWorkAllowed() then
if lsc:hasWork() then
Expand All @@ -51,7 +50,7 @@ local function exec(address, name, location)
state = states.BROKEN
end
local status = nil
if #lsc.getSensorInformation() > 16 then
if #lsc.getSensorInformation() > 20 then
status = {
name = name,
state = state,
Expand All @@ -64,6 +63,19 @@ local function exec(address, name, location)
EUOut = parser.getInteger(sensorInformation[9] or 0),
wirelessEU = parser.getInteger(sensorInformation[19] or 0)
}
elseif #lsc.getSensorInformation() > 16 then
status = {
name = name,
state = state,
storedEU = parser.getInteger(sensorInformation[2]),
EUCapacity = parser.getInteger(sensorInformation[5]),
problems = problems,
passiveLoss = parser.getInteger(sensorInformation[7] or 0),
location = location,
EUIn = parser.getInteger(sensorInformation[8] or 0),
EUOut = parser.getInteger(sensorInformation[9] or 0),
wirelessEU = parser.getInteger(sensorInformation[18] or 0)
}
else
status = {
name = name,
Expand Down

0 comments on commit ad244df

Please sign in to comment.