From c0fc43b4ca140dde655082fd7b6bbe9f26ea223e Mon Sep 17 00:00:00 2001 From: James Brundage <@github.com> Date: Sun, 28 Jan 2024 10:05:46 -0800 Subject: [PATCH] feat: Set-Awtrix -EffectSpeed ( Fixes #112 ) --- Functions/Awtrix/Set-Awtrix.ps1 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Functions/Awtrix/Set-Awtrix.ps1 b/Functions/Awtrix/Set-Awtrix.ps1 index 1771658..436f70d 100644 --- a/Functions/Awtrix/Set-Awtrix.ps1 +++ b/Functions/Awtrix/Set-Awtrix.ps1 @@ -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')] @@ -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) {