Minor updates and fixes

This commit is contained in:
Victor Hagelbäck 2021-02-08 19:55:18 +01:00
parent f93d3854d0
commit c6d7bc2e3e
5 changed files with 8 additions and 8 deletions

View file

@ -28,7 +28,7 @@ class DeviceRegistry {
}
addScene(scene) {
this.plejdDevices[scene.id] = scene;
this.sceneDevices[scene.id] = scene;
}
setApiSite(siteDetails) {

View file

@ -16,7 +16,7 @@ COPY ./MqttClient.js /plejd/
COPY ./package.json /plejd/
COPY ./PlejdAddon.js /plejd/
COPY ./PlejdApi.js /plejd/
COPY ./PlejdBLE.js /plejd/
COPY ./PlejdBLEHandler.js /plejd/
COPY ./Scene.js /plejd/
COPY ./SceneManager.js /plejd/
COPY ./SceneStep.js /plejd/

View file

@ -32,7 +32,7 @@ class Logger {
}
static getLogLevel() {
const config = Configuration.getConfiguration();
const config = Configuration.getOptions();
// eslint-disable-next-line max-len
const level = (config.logLevel && LEVELS.find((l) => l.startsWith(config.logLevel[0].toLowerCase())))
|| 'info';

View file

@ -24,14 +24,14 @@ class SceneManager extends EventEmitter {
this.scenes = {};
scenes.forEach((scene) => {
const idx = this.deviceRegistry.apiSite.sceneIndex[scene.sceneId];
this.scenes[scene.sceneId] = new Scene(idx, scene, this.deviceRegistry.apiSite.sceneSteps);
this.scenes[scene.id] = new Scene(idx, scene, this.deviceRegistry.apiSite.sceneSteps);
});
}
executeScene(sceneIndex) {
const scene = this.scenes[sceneIndex];
executeScene(sceneId) {
const scene = this.scenes[sceneId];
if (!scene) {
logger.info(`Scene with id ${sceneIndex} not found`);
logger.info(`Scene with id ${sceneId} not found`);
logger.verbose(`Scenes: ${JSON.stringify(this.scenes, null, 2)}`);
return;
}

View file

@ -1,4 +1,4 @@
const PlejdBLE = require('../PlejdBLE');
const PlejdBLE = require('../PlejdBLEHandler');
const cryptoKey = '';