From f7096744c2cdb31e148d879f55be8dd71d31056e Mon Sep 17 00:00:00 2001 From: hl Date: Thu, 27 Sep 2018 12:19:21 +0800 Subject: [PATCH] Update main.js --- main.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/main.js b/main.js index 9a7866a..9e1cbcd 100644 --- a/main.js +++ b/main.js @@ -77,8 +77,34 @@ function processMessages() { }); } +function createObject() { + //adapter.setObject('config.0.voltage.50002', json, function (err) { + // if (err) log('Cannot write object: ' + err); + //}); + adapter.setObject('config.0.voltage.50002', { + custom: { + min: 320, + max: 400, + interval: 5, + count: 2 + }, + common: { + name: "50002", + role: "", + type: "array", + desc: "pushover创建", + read: true, + write: true + } + }, function () { + adapter.log.info('Save ' + userdataDir + 'pushover.json'); + }); + +} + function main() { // Adapter is started only if some one writes into "system.adapter.pushover.X.messagebox" new value + createObject(); processMessages(); stop(); }