Skip to content
This repository has been archived by the owner on Sep 25, 2020. It is now read-only.

Add computer.getDeviceInfo - untested, may need some fixes #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions src/apis/computer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,24 @@ function env.computer.setArchitecture(archName)
end
return false
end
local template = {
gpu = {
capacity = 8000
},
screen = {
capacity = 8000
}
}
function env.computer.getDeviceInfo()
cprint("computer.getDeviceInfo")
local info = {}
for a, t in env.component.list() do
info[a] = {}
if template[t] then
for k, v in pairs(template[t]) do
info[a][k] = v
end
end
end
return info
end