Handle when scene and device have the same Id

- Catch emitted errors in Mqtt
This commit is contained in:
Victor Hagelbäck 2021-02-10 10:10:28 +01:00
parent dca491bf00
commit ef7a5086a1
4 changed files with 27 additions and 10 deletions

View file

@ -24,7 +24,7 @@ class SceneManager extends EventEmitter {
this.scenes = {};
scenes.forEach((scene) => {
const idx = this.deviceRegistry.apiSite.sceneIndex[scene.sceneId];
this.scenes[scene.id] = new Scene(idx, scene, this.deviceRegistry.apiSite.sceneSteps);
this.scenes[idx] = new Scene(idx, scene, this.deviceRegistry.apiSite.sceneSteps);
});
}