manipulator modules working after detach/reattach
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
packages/common/ascii.lua urlfs http://pastebin.com/raw/u3kcnyjd
|
||||
packages/common/hexedit.lua urlfs https://pastebin.com/raw/Ds9ajsp4
|
||||
packages/common/colors.lua urlfs https://raw.githubusercontent.com/kepler155c/opus-apps/develop-1.8/ignore/colors.lua
|
||||
@@ -1,5 +1,4 @@
|
||||
_G.requireInjector(_ENV)
|
||||
local Util = require('util')
|
||||
local Util = require('opus.util')
|
||||
|
||||
local colors = _G.colors
|
||||
local term = _G.term
|
||||
|
||||
@@ -67,7 +67,7 @@ function Storage:init()
|
||||
|
||||
Event.on({ 'device_attach', 'device_detach' }, function(e, dev)
|
||||
_G._syslog('%s: %s', e, tostring(dev))
|
||||
self:initStorage()
|
||||
self:initStorage() -- this can yield - so we might miss events
|
||||
end)
|
||||
Event.onInterval(60, function()
|
||||
self:showStorage()
|
||||
@@ -111,6 +111,9 @@ function Storage:initStorage()
|
||||
if v.mtype ~= 'hidden' then
|
||||
if v.adapter then
|
||||
v.adapter.online = not not device[k]
|
||||
if v.adapter.online then
|
||||
Util.merge(v.adapter, device[k])
|
||||
end
|
||||
elseif device[k] and device[k].list and device[k].size and device[k].pullItems then
|
||||
if v.adapterType then
|
||||
v.adapter = require(v.adapterType)({ side = k })
|
||||
|
||||
Reference in New Issue
Block a user