increased version

This commit is contained in:
Marcus Westin 2020-06-12 11:15:24 +02:00
parent 8a2da6d46f
commit fb585a6550
2 changed files with 14 additions and 14 deletions

View file

@ -1,6 +1,6 @@
{
"name": "Plejd",
"version": "0.4.6",
"version": "0.4.7",
"slug": "plejd",
"description": "Adds support for the Swedish home automation devices from Plejd.",
"url": "https://github.com/icanos/hassio-plejd/",
@ -38,4 +38,4 @@
"connectionTimeout": "int",
"writeQueueWaitTime": "int"
}
}
}

View file

@ -4,7 +4,7 @@ const fs = require('fs');
const PlejdService = require('./ble.bluez');
const SceneManager = require('./scene.manager');
const version = "0.4.6";
const version = "0.4.7";
async function main() {
console.log('starting Plejd add-on v. ' + version);
@ -76,22 +76,24 @@ async function main() {
if (typeof command === 'string') {
// switch command
state = command;
commandObj = { state: state };
commandObj = {
state: state
};
// since the switch doesn't get any updates on whether it's on or not,
// we fake this by directly send the updateState back to HA in order for
// it to change state.
client.updateState(deviceId, { state: state === 'ON' ? 1 : 0 });
}
else {
client.updateState(deviceId, {
state: state === 'ON' ? 1 : 0
});
} else {
state = command.state;
commandObj = command;
}
if (state === 'ON') {
plejd.turnOn(deviceId, commandObj);
}
else {
} else {
plejd.turnOff(deviceId, commandObj);
}
});
@ -99,11 +101,9 @@ async function main() {
client.on('settingsChanged', (settings) => {
if (settings.module === 'mqtt') {
client.updateSettings(settings);
}
else if (settings.module === 'ble') {
} else if (settings.module === 'ble') {
plejd.updateSettings(settings);
}
else if (settings.module === 'api') {
} else if (settings.module === 'api') {
plejdApi.updateSettings(settings);
}
});
@ -112,4 +112,4 @@ async function main() {
});
}
main();
main();