Update main.js
This commit is contained in:
parent
767bc314e5
commit
f7096744c2
26
main.js
26
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() {
|
function main() {
|
||||||
// Adapter is started only if some one writes into "system.adapter.pushover.X.messagebox" new value
|
// Adapter is started only if some one writes into "system.adapter.pushover.X.messagebox" new value
|
||||||
|
createObject();
|
||||||
processMessages();
|
processMessages();
|
||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user