From 1b267562038d622257839712af0ad88dc127a268 Mon Sep 17 00:00:00 2001 From: Kevin Van den Abeele Date: Sun, 11 Aug 2019 09:51:56 +0200 Subject: [PATCH] Fixed issue with support for fan speed --- README.md | 2 +- package.json | 2 +- src/lg/wideq.js | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a1bf34b..01dc4f0 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ After that an update of the state is performed every minute. ## Hardware Requirements -- A SmartThinq compatible LG airco unit (Tested with an ) +- A SmartThinq compatible LG airco unit (Tested with an PC12SQ NSJ) ## Setup guide diff --git a/package.json b/package.json index b7498bb..25edb16 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-lg-airco", - "version": "0.0.4", + "version": "0.0.5", "description": "Homebridge plugin to control a Smart Thinq enabled LG airco unit. Makes use of WideQ => https://github.com/sampsyo/wideq", "main": "src/index.js", "scripts": { diff --git a/src/lg/wideq.js b/src/lg/wideq.js index dcbf7df..54c67ad 100644 --- a/src/lg/wideq.js +++ b/src/lg/wideq.js @@ -63,7 +63,7 @@ module.exports.Wideq = function (country, language) { me.paramConversion = { getSpeedAsNumber: (speed) => { - switch (speed) { + switch (speed.value) { case '@AC_MAIN_WIND_STRENGTH_SLOW_W': return 12.5; case '@AC_MAIN_WIND_STRENGTH_SLOW_LOW_W': @@ -80,6 +80,8 @@ module.exports.Wideq = function (country, language) { return 87.5; case '@AC_MAIN_WIND_STRENGTH_POWER_W': return 100; + default: + console.log('Unknown value: ' + JSON.stringify(speed, null, 4)); } }, isOn: (state) => {