Refactor code to use plejd outputs rather than devices as main entity

This commit is contained in:
Victor Hagelbäck 2021-03-31 20:04:45 +02:00
parent ef718cf1db
commit 9a76a3ba50
10 changed files with 185 additions and 158 deletions

View file

@ -1,7 +1,11 @@
class SceneStep {
/**
* @param {import("./types/ApiSite").SceneStep} step
*/
constructor(step) {
this.sceneId = step.sceneId;
this.deviceId = step.deviceId;
this.output = step.output;
this.state = step.state === 'On' ? 1 : 0;
this.brightness = step.value;
}