Skip to content

Commit

Permalink
feat: Set-Awtrix -EffectSpeed ( Fixes #112 )
Browse files Browse the repository at this point in the history
  • Loading branch information
James Brundage committed Jan 28, 2024
1 parent 78e1b6e commit c0fc43b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Functions/Awtrix/Set-Awtrix.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ function Set-Awtrix
[PSObject]
$EffectOption,

# The speed of the effect
[Parameter(ValueFromPipelineByPropertyName)]
[Alias('EffectSpeeds')]
[int]
$EffectSpeed,

# Any options related to the notification.
[Parameter(ValueFromPipelineByPropertyName)]
[Alias('NotificationOptions','NotificationParameter','NotificationParameters')]
Expand Down Expand Up @@ -290,8 +296,13 @@ function Set-Awtrix

if ($EffectOption) {
$invokeSplat.Body.effectSettings = $EffectOption
} elseif ($EffectName) {
# $invokeSplat.Body.effectSettings = @{speed=10;palette='Rainbow'}
}

if ($EffectSpeed) {
if (-not $invokeSplat.Body.effectSettings) {
$invokeSplat.Body.effectSettings = @{}
}
$invokeSplat.Body.effectSettings.speed = $EffectSpeed
}

if ($HoldNotification) {
Expand Down

0 comments on commit c0fc43b

Please sign in to comment.