Skip to content

Commit

Permalink
Merge pull request #6 from bwp91/beta
Browse files Browse the repository at this point in the history
2.0.2
  • Loading branch information
bwp91 authored Oct 19, 2020
2 parents 6c76645 + 1dc06eb commit 7259b79
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 17 deletions.
4 changes: 2 additions & 2 deletions lib/device-led.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/govee-http.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 1 addition & 3 deletions lib/govee-platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
},
Expand Down
10 changes: 3 additions & 7 deletions lib/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 7259b79

Please sign in to comment.