Update main.js

This commit is contained in:
hl 2018-09-27 12:19:21 +08:00
parent 767bc314e5
commit f7096744c2

26
main.js
View File

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