more type hints and resolved diagnostic disables with 'as'
This commit is contained in:
@@ -295,8 +295,12 @@ local function config_view(display)
|
||||
for i = 1, tmp_cfg.UnitCount do
|
||||
local conf = tool_ctl.cooling_elems[i]
|
||||
-- already verified fields are numbers
|
||||
---@diagnostic disable-next-line: assign-type-mismatch
|
||||
tmp_cfg.CoolingConfig[i] = { TurbineCount = tonumber(conf.turbines.get_value()), BoilerCount = tonumber(conf.boilers.get_value()), TankConnection = conf.tank.get_value() }
|
||||
tmp_cfg.CoolingConfig[i] = {
|
||||
TurbineCount = tonumber(conf.turbines.get_value()) --[[@as number]],
|
||||
BoilerCount = tonumber(conf.boilers.get_value()) --[[@as number]],
|
||||
TankConnection = conf.tank.get_value()
|
||||
}
|
||||
|
||||
if conf.tank.get_value() then any_has_tank = true end
|
||||
end
|
||||
|
||||
|
||||
@@ -41,9 +41,7 @@ function rsctl.new(redstone_rtus)
|
||||
function public.digital_read(port)
|
||||
for i = 1, #redstone_rtus do
|
||||
local io = redstone_rtus[i].get_db().io[port]
|
||||
-- this would only be digital, so it would only return boolean or nil
|
||||
---@diagnostic disable-next-line: return-type-mismatch
|
||||
if io ~= nil then return io.read() end
|
||||
if io ~= nil then return io.read() --[[@as boolean|nil]] end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user