#536 proper clearing of cleared config values

This commit is contained in:
Mikayla Fischler 2024-08-20 20:56:41 -04:00
parent c323967b6a
commit 6917697290
10 changed files with 15 additions and 10 deletions

View File

@ -959,7 +959,8 @@ local function config_view(display)
end end
local function save_and_continue() local function save_and_continue()
for k, v in pairs(tmp_cfg) do for _, field in ipairs(fields) do
local k, v = field[1], tmp_cfg[field[1]]
if v == nil then settings.unset(k) else settings.set(k, v) end if v == nil then settings.unset(k) else settings.set(k, v) end
end end

View File

@ -19,7 +19,7 @@ local renderer = require("coordinator.renderer")
local sounder = require("coordinator.sounder") local sounder = require("coordinator.sounder")
local threads = require("coordinator.threads") local threads = require("coordinator.threads")
local COORDINATOR_VERSION = "v1.5.3" local COORDINATOR_VERSION = "v1.5.4"
local CHUNK_LOAD_DELAY_S = 30.0 local CHUNK_LOAD_DELAY_S = 30.0

View File

@ -379,7 +379,8 @@ local function config_view(display)
end end
local function save_and_continue() local function save_and_continue()
for k, v in pairs(tmp_cfg) do for _, field in ipairs(fields) do
local k, v = field[1], tmp_cfg[field[1]]
if v == nil then settings.unset(k) else settings.set(k, v) end if v == nil then settings.unset(k) else settings.set(k, v) end
end end

View File

@ -20,7 +20,7 @@ local pocket = require("pocket.pocket")
local renderer = require("pocket.renderer") local renderer = require("pocket.renderer")
local threads = require("pocket.threads") local threads = require("pocket.threads")
local POCKET_VERSION = "v0.11.5-alpha" local POCKET_VERSION = "v0.11.6-alpha"
local println = util.println local println = util.println
local println_ts = util.println_ts local println_ts = util.println_ts

View File

@ -450,7 +450,8 @@ function system.create(tool_ctl, main_pane, cfg_sys, divs, style, exit)
end end
local function save_and_continue() local function save_and_continue()
for k, v in pairs(tmp_cfg) do for _, field in ipairs(fields) do
local k, v = field[1], tmp_cfg[field[1]]
if v == nil then settings.unset(k) else settings.set(k, v) end if v == nil then settings.unset(k) else settings.set(k, v) end
end end

View File

@ -18,7 +18,7 @@ local plc = require("reactor-plc.plc")
local renderer = require("reactor-plc.renderer") local renderer = require("reactor-plc.renderer")
local threads = require("reactor-plc.threads") local threads = require("reactor-plc.threads")
local R_PLC_VERSION = "v1.8.4" local R_PLC_VERSION = "v1.8.5"
local println = util.println local println = util.println
local println_ts = util.println_ts local println_ts = util.println_ts

View File

@ -650,7 +650,8 @@ local function config_view(display)
---@param exclude_conns boolean? true to exclude saving peripheral/redstone connections ---@param exclude_conns boolean? true to exclude saving peripheral/redstone connections
local function save_and_continue(exclude_conns) local function save_and_continue(exclude_conns)
for k, v in pairs(tmp_cfg) do for _, field in ipairs(fields) do
local k, v = field[1], tmp_cfg[field[1]]
if not (exclude_conns and (k == "Peripherals" or k == "Redstone")) then if not (exclude_conns and (k == "Peripherals" or k == "Redstone")) then
if v == nil then settings.unset(k) else settings.set(k, v) end if v == nil then settings.unset(k) else settings.set(k, v) end
end end

View File

@ -31,7 +31,7 @@ local sna_rtu = require("rtu.dev.sna_rtu")
local sps_rtu = require("rtu.dev.sps_rtu") local sps_rtu = require("rtu.dev.sps_rtu")
local turbinev_rtu = require("rtu.dev.turbinev_rtu") local turbinev_rtu = require("rtu.dev.turbinev_rtu")
local RTU_VERSION = "v1.10.4" local RTU_VERSION = "v1.10.5"
local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE local RTU_UNIT_TYPE = types.RTU_UNIT_TYPE
local RTU_UNIT_HW_STATE = databus.RTU_UNIT_HW_STATE local RTU_UNIT_HW_STATE = databus.RTU_UNIT_HW_STATE

View File

@ -907,7 +907,8 @@ local function config_view(display)
end end
local function save_and_continue() local function save_and_continue()
for k, v in pairs(tmp_cfg) do for _, field in ipairs(fields) do
local k, v = field[1], tmp_cfg[field[1]]
if v == nil then settings.unset(k) else settings.set(k, v) end if v == nil then settings.unset(k) else settings.set(k, v) end
end end

View File

@ -21,7 +21,7 @@ local supervisor = require("supervisor.supervisor")
local svsessions = require("supervisor.session.svsessions") local svsessions = require("supervisor.session.svsessions")
local SUPERVISOR_VERSION = "v1.4.4" local SUPERVISOR_VERSION = "v1.4.5"
local println = util.println local println = util.println
local println_ts = util.println_ts local println_ts = util.println_ts