Skip to content

Commit

Permalink
colormode may not be returned for all lights
Browse files Browse the repository at this point in the history
  • Loading branch information
T Bryce Yehl committed Mar 31, 2018
1 parent 5a294fd commit 84f4be2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions PoSHue.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -536,12 +536,14 @@ Class HueLight : HueFactory {

$this.Hue = $Status.state.hue
$this.Saturation = $Status.state.sat
$this.ColourMode = $Status.state.colormode
if(Get-Member -inputobject $Status.state -name "colormode" -Membertype Properties) {
$this.ColourMode = $Status.state.colormode

# This is for compatibility reasons on Philips Ambient Lights
if ($Status.state.colormode -eq "xy") {
$this.XY.x = $Status.state.xy[0]
$this.XY.y = $Status.state.xy[1]
# This is for compatibility reasons on Philips Ambient Lights
if ($Status.state.colormode -eq "xy") {
$this.XY.x = $Status.state.xy[0]
$this.XY.y = $Status.state.xy[1]
}
}

If ($Status.state.ct) {
Expand Down

0 comments on commit 84f4be2

Please sign in to comment.