diff --git a/lib/device-led.js b/lib/device-led.js index b1a7acfb..cf2dddd8 100644 --- a/lib/device-led.js +++ b/lib/device-led.js @@ -124,8 +124,8 @@ module.exports = class deviceLED { if (helpers.hasProperty(newParams, 'colorTemInKelvin')) { const rgbArray = cTemp.temp2rgb(newParams.colorTemInKelvin) rgb.r = rgbArray[0] - rgb.b = rgbArray[1] - rgb.g = rgbArray[2] + rgb.g = rgbArray[1] + rgb.b = rgbArray[2] } else { rgb.r = newParams.color.r rgb.g = newParams.color.g diff --git a/lib/govee-http.js b/lib/govee-http.js index 65386616..f506ded9 100644 --- a/lib/govee-http.js +++ b/lib/govee-http.js @@ -15,7 +15,7 @@ module.exports = class goveeHTTP { const res = await axios.get('https://developer-api.govee.com/v1/devices', { headers: { 'Govee-API-Key': this.apiKey } }) const body = res.data if (this.debugReqRes) { - this.log('[getDevices()] HTTP Response:\n%s', JSON.stringify(body.data || body, null, 2)) + this.log('[getDevices()] HTTP Response:\n%s', JSON.stringify(body, null, 2)) } if (body.code !== 200 || !helpers.hasProperty(body, 'data')) { throw new Error( @@ -42,7 +42,7 @@ module.exports = class goveeHTTP { }) const body = res.data if (this.debugReqRes) { - this.log('[getDevice()] HTTP Response:\n%s', JSON.stringify(body.data || body, null, 2)) + this.log('[getDevice()] HTTP Response:\n%s', JSON.stringify(body, null, 2)) } if (body.code !== 200 || !helpers.hasProperty(body, 'data')) { throw new Error( @@ -77,7 +77,7 @@ module.exports = class goveeHTTP { }) const body = res.data if (this.debugReqRes) { - this.log('[updateDevice()] HTTP Response:\n%s', JSON.stringify(body.data || body, null, 2)) + this.log('[updateDevice()] HTTP Response:\n%s', JSON.stringify(body, null, 2)) } if (body.code !== 200 || !helpers.hasProperty(body, 'data')) { throw new Error( diff --git a/lib/govee-platform.js b/lib/govee-platform.js index 89e7f071..8b0891d8 100644 --- a/lib/govee-platform.js +++ b/lib/govee-platform.js @@ -51,9 +51,7 @@ module.exports = class goveePlatform { try { await this.goveeSync() } catch (err) { - if (this.debug) { - this.log.warn(err.message) - } + if (this.debug) this.log.warn(err.message) } } }, diff --git a/lib/helpers.js b/lib/helpers.js index ae22cf8e..3df20fa9 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -13,12 +13,8 @@ module.exports = { 'H6002', 'H6003', 'H6148' ], modelsNoScaleBrightness: [ - 'H6110', 'H6159', 'H6182' + 'H6089', 'H6110', 'H6159', 'H6182' ], - sleep: ms => { - return new Promise(resolve => setTimeout(resolve, ms)) - }, - hasProperty: (obj, prop) => { - return Object.prototype.hasOwnProperty.call(obj, prop) - } + sleep: ms => new Promise(resolve => setTimeout(resolve, ms)), + hasProperty: (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop) } diff --git a/package-lock.json b/package-lock.json index 41c97031..9d69d265 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "homebridge-govee", - "version": "2.0.1", + "version": "2.0.2-0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 052cbd5b..40457090 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-govee", - "version": "2.0.1", + "version": "2.0.2-0", "author": "bwp91", "description": "Homebridge plugin to control Govee devices that are supported by the official Govee API.", "license": "MIT",