From 6b6b346e09d73641cc6cc7bffe98fe5051fa9962 Mon Sep 17 00:00:00 2001 From: Jan Scheiper Date: Fri, 25 Dec 2020 02:38:10 +0100 Subject: [PATCH] fixed some more bugs related to the effects --- HCschalkematrix.js | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/HCschalkematrix.js b/HCschalkematrix.js index 0fa5e70..c9053a6 100644 --- a/HCschalkematrix.js +++ b/HCschalkematrix.js @@ -107,7 +107,7 @@ class HCschalkematrix extends HCColorLamp { // try to match the effect as best as possible if (speeds[msg.effect] != undefined) { if (speeds[msg.effect].length == 1) { - newState.effect = speeds[msg.effect][0][1]; + newState.effect = speeds[msg.effect][0].id; } else { let lowestDist = Infinity; let lowestDistId = null; @@ -121,6 +121,8 @@ class HCschalkematrix extends HCColorLamp { newState.effect = lowestDistId; } + } else if (msg.effect == 0) { + newState.effect = "none"; } this._sumanager.insertConfirmedState(newState); diff --git a/package.json b/package.json index 7d4ffdc..cb8b9be 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hc-schalkematrix", - "version": "1.0.0", + "version": "1.0.1", "description": "A homecontrol control which interfaces with the LED matrix panel I made", "main": "HCschalkematrix.js", "scripts": {