From d8e0a669af745b5d666e5af2fb3e407faacb8854 Mon Sep 17 00:00:00 2001 From: "kepler155c@gmail.com" Date: Tue, 12 Mar 2019 10:20:02 -0400 Subject: [PATCH] milo config backups --- milo/plugins/backupView.lua | 4 +++- milo/plugins/speakerView.lua | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/milo/plugins/backupView.lua b/milo/plugins/backupView.lua index 86a38fd..71899df 100644 --- a/milo/plugins/backupView.lua +++ b/milo/plugins/backupView.lua @@ -4,6 +4,7 @@ local Milo = require('milo') local UI = require('ui') local colors = _G.colors +local device = _G.device local fs = _G.fs local os = _G.os @@ -30,7 +31,8 @@ local wizardPage = UI.WizardPage { } function wizardPage:isValidType(node) - return node.adapter and node.adapter.type == 'drive' and { + local m = device[node.name] + return m and m.type == 'drive' and { name = 'Backup Drive', value = 'backup', category = 'custom', diff --git a/milo/plugins/speakerView.lua b/milo/plugins/speakerView.lua index ea5af6c..8015d97 100644 --- a/milo/plugins/speakerView.lua +++ b/milo/plugins/speakerView.lua @@ -2,9 +2,9 @@ local Milo = require('milo') local Sound = require('sound') local UI = require('ui') -local colors = _G.colors -local context = Milo:getContext() -local peripheral = _G.peripheral +local colors = _G.colors +local device = _G.device +local context = Milo:getContext() local speakerNode = context.storage:getSingleNode('speaker') if speakerNode then @@ -50,7 +50,8 @@ function wizardPage:validate() end function wizardPage:isValidType(node) - return node.adapter and node.adapter.type == 'speaker' and { + local m = device[node.name] + return m and m.type == 'speaker' and { name = 'Speaker', value = 'speaker', category = 'custom',