Skip to content

Commit

Permalink
Set-NanoLeaf: Adding -BrightnessIncrement (Fixes #34) and Fixing -Sat…
Browse files Browse the repository at this point in the history
…urationIncrement (Fixes #35)
  • Loading branch information
James Brundage committed Oct 12, 2022
1 parent c5b4824 commit 55b4421
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions Functions/NanoLeaf/Set-NanoLeaf.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
# Increments the saturation of the NanoLeaf light color.
[ComponentModel.DefaultBindingProperty('sat')]
[ComponentModel.AmbientValue({
[PSCustomObject]@{increment=[int][Math]::Round($_)}
[PSCustomObject]@{increment=[int][Math]::Round($_ * 100)}
})]
[int]
$SaturationIncrement,
Expand All @@ -97,6 +97,17 @@
[double]
$Brightness,

# The brightness increment.
# If no other parameters are provided, adjusts universal brightness.
[Parameter(ValueFromPipelineByPropertyName)]
[ComponentModel.DefaultBindingProperty('brightness')]
[ComponentModel.AmbientValue({
[PSCustomObject]@{increment=[int][Math]::Round($_ * 100)}
})]
[ValidateRange(-1,1)]
[double]
$BrightnessIncrement,

# If set, will change all panels on the nanoleaf to a given color temperature.
[Parameter(ValueFromPipelineByPropertyName)]
[ComponentModel.DefaultBindingProperty('ct')]
Expand Down Expand Up @@ -336,8 +347,8 @@
} else {
$sendData.brightness.duration = 0
}
}

}
if ($on) {
$sendData.on = @{value=$true}
}
Expand Down

0 comments on commit 55b4421

Please sign in to comment.