Skip to content
This repository was archived by the owner on Sep 25, 2020. It is now read-only.
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