#101 fixed averages and display them

This commit is contained in:
Mikayla Fischler
2023-02-03 21:05:21 -05:00
parent a117d5ee97
commit ba8bfb6e14
6 changed files with 39 additions and 30 deletions

View File

@@ -307,9 +307,9 @@ function iocontrol.update_facility_status(status)
if type(rtu_statuses) == "table" then
-- power statistics
if type(rtu_statuses.power) == "table" then
fac.ps.publish("avg_charge", rtu_statuses.power[1])
fac.ps.publish("avg_inflow", rtu_statuses.power[2])
fac.ps.publish("avg_outflow", rtu_statuses.power[3])
fac.induction_ps_tbl[1].publish("avg_charge", rtu_statuses.power[1])
fac.induction_ps_tbl[1].publish("avg_inflow", rtu_statuses.power[2])
fac.induction_ps_tbl[1].publish("avg_outflow", rtu_statuses.power[3])
else
log.debug(log_header .. "power statistics list not a table")
end