Merge branch 'dev' of https://github.com/icanos/hassio-plejd into dev
This commit is contained in:
commit
bde7a473be
3 changed files with 20 additions and 7 deletions
|
|
@ -92,7 +92,12 @@ class PlejdService extends EventEmitter {
|
|||
|
||||
let i = 0;
|
||||
const transitionRef = setInterval(() => {
|
||||
this._turnOn(id, parseInt((brightnessStep * i) + 1));
|
||||
let currentBrightness = parseInt((brightnessStep * i) + 1);
|
||||
if (currentBrightness > 254) {
|
||||
currentBrightness = 254;
|
||||
}
|
||||
|
||||
this._turnOn(id, currentBrightness);
|
||||
|
||||
if (i >= steps) {
|
||||
clearInterval(transitionRef);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,11 @@ const mqtt = require('./mqtt');
|
|||
const fs = require('fs');
|
||||
const PlejdService = require('./ble');
|
||||
|
||||
const version = "0.2.0";
|
||||
|
||||
async function main() {
|
||||
console.log('starting Plejd add-on v. ' + version);
|
||||
|
||||
const rawData = fs.readFileSync('/data/plejd.json');
|
||||
const config = JSON.parse(rawData);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue