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(); }