Skip to content

Commit

Permalink
fix error loading color picker
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbdavis committed Oct 4, 2018
1 parent b898215 commit 49b5618
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.0
0.2.1
13 changes: 10 additions & 3 deletions light-entity-row.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,16 @@ class AdjustableLightEntityRow extends Polymer.Element {

if (this._config.showColorPicker && this.isSupported(SUPPORT_RGB_COLOR)) {
this.showColorPicker = true
this.currentColor = {
h: this.stateObj.attributes.hs_color[0],
s: this.stateObj.attributes.hs_color[1]
if (this.stateObj.attributes && this.stateObj.attributes.hs_color && Array.isArray(this.stateObj.attributes.hs_color)) {
this.currentColor = {
h: this.stateObj.attributes.hs_color[0],
s: this.stateObj.attributes.hs_color[1]
}
} else {
this.currentColor = {
h: 0,
s: 0
}
}
}
if (this._config.showColorSliders && this.isSupported(SUPPORT_RGB_COLOR)) {
Expand Down

0 comments on commit 49b5618

Please sign in to comment.