added type def to ppm and return a copy of the peripherals list rather than the table itself

This commit is contained in:
Mikayla Fischler
2023-11-04 12:56:49 -04:00
parent 25f68f338c
commit eff3444834
2 changed files with 10 additions and 6 deletions

View File

@ -161,10 +161,10 @@ local function peri_init(iface)
setmetatable(self.device, mt) setmetatable(self.device, mt)
return { ---@class ppm_entry
type = self.type, local entry = { type = self.type, dev = self.device }
dev = self.device
} return entry
end end
---------------------- ----------------------
@ -310,7 +310,11 @@ function ppm.list_avail() return peripheral.getNames() end
-- list mounted peripherals -- list mounted peripherals
---@nodiscard ---@nodiscard
---@return table mounts ---@return table mounts
function ppm.list_mounts() return ppm_sys.mounts end function ppm.list_mounts()
local list = {}
for k, v in pairs(ppm_sys.mounts) do list[k] = v end
return list
end
-- get a mounted peripheral side/interface by device table -- get a mounted peripheral side/interface by device table
---@nodiscard ---@nodiscard

View File

@ -18,7 +18,7 @@ local type = type
local util = {} local util = {}
-- scada-common version -- scada-common version
util.version = "1.1.6" util.version = "1.1.7"
util.TICK_TIME_S = 0.05 util.TICK_TIME_S = 0.05
util.TICK_TIME_MS = 50 util.TICK_TIME_MS = 50