Skip to content

Commit

Permalink
fix another HS setting error (phillips)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbdavis committed Oct 4, 2018
1 parent 49b5618 commit 02d8dd9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.1
0.2.2
9 changes: 7 additions & 2 deletions light-entity-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,13 @@ class AdjustableLightEntityRow extends Polymer.Element {
if(this.stateObj.state === 'on') {
this.brightness = this.stateObj.attributes.brightness/2.55;
this.color_temp = this.stateObj.attributes.color_temp;
this.color_hue = this.stateObj.attributes.hs_color[0];
this.color_saturation = this.stateObj.attributes.hs_color[1];
if (this.stateObj.attributes.hs_color && Array.isArray(this.stateObj.attributes.hs_color)) {
this.color_hue = this.stateObj.attributes.hs_color[0];
this.color_saturation = this.stateObj.attributes.hs_color[1];
} else {
this.color_hue = 0
this.color_saturation = 0
}
this.isOn = true;
} else {
this.brightness = this.brightnessMin;
Expand Down

0 comments on commit 02d8dd9

Please sign in to comment.