Skip to content

Commit

Permalink
keywords.robot: Add filtering to windows audio detection
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Czapla <[email protected]>
  • Loading branch information
SebastianCzapla committed Dec 16, 2024
1 parent ca04291 commit 0b90236
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions keywords.robot
Original file line number Diff line number Diff line change
Expand Up @@ -752,11 +752,20 @@ Get Power Supply State
RETURN ${state}

Get Sound Devices Windows
[Documentation] Get and return all sound devices in Windows OS using
... PowerShell
${out}= Execute Command In Terminal
... Get-PnpDevice -PresentOnly | Where-Object {$_.Class -match "Audio" -or $_.Name -match "Audio"} | Select-Object Name, Status
RETURN ${out}
[Documentation] Get and return sound devices via PowerShell
... filtered as all devices, audio-sink only, or microphones only
[Arguments] ${filter}
IF '${filer}' == 'all'
${out}= Execute Command In Terminal
... Get-PnpDevice -PresentOnly | Where-Object {$_.Class -match "Audio" -or $_.Name -match "Audio"} | Select-Object Name, Status
ELSE IF '${filter}' == 'sink'
${out}= Execute Command In Terminal
... Get-PnpDevice -PresentOnly | Where-Object {($_.Class -match "Audio") -and ($_.Name -match "Speaker" -or $_.Name -match "HDMI" -or $_.Name -match "Output")} | Select-Object Name, Status
ELSE IF '${filter}' == 'microphone'
${out}= Execute Command In Terminal
... Get-PnpDevice -PresentOnly | Where-Object {$_.Class -match "Audio" -and $_.Name -match "Microphone"} | Select-Object Name, Status
END
RETURN ${out}

Get USB Devices Windows
[Documentation] Get and return all USB devices in Windows OS using
Expand Down

0 comments on commit 0b90236

Please sign in to comment.