1
0
mirror of https://github.com/kepler155c/opus synced 2025-10-21 18:57:41 +00:00

remove dependency on device global

This commit is contained in:
kepler155c@gmail.com
2019-03-11 23:48:22 -04:00
parent bd9b2825be
commit 04af12b452
3 changed files with 11 additions and 10 deletions

View File

@@ -1,7 +1,6 @@
local UI = require('ui')
local colors = _G.colors
local device = _G.device
local peripheral = _G.peripheral
local settings = _G.settings
@@ -34,11 +33,9 @@ local tab = UI.Tab {
function tab:enable()
local choices = { }
for _,v in pairs(device) do
if v.type == 'monitor' then
table.insert(choices, { name = v.side, value = v.side })
end
end
peripheral.find('monitor', function(side)
table.insert(choices, { name = side, value = side })
end)
self.form.monitor.choices = choices
self.form.monitor.value = settings.get('kiosk.monitor')