Skip to content

Commit

Permalink
Add support for incoming calls, remove iconMonitoring var as it was n…
Browse files Browse the repository at this point in the history
…ot used
  • Loading branch information
AntoineGS committed Jul 4, 2022
1 parent a2323e9 commit 03a17d4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 6 additions & 1 deletion Get-TeamsStatus.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ Get-Content -Path "C:\Users\$env:USERNAME\AppData\Roaming\Microsoft\Teams\logs.t
'SfB:TeamsNoCall',`
'SfB:TeamsPendingCall',`
'SfB:TeamsActiveCall',`
'name: desktop_call_state_change_send, isOngoing' | Select-Object -Last 1
'name: desktop_call_state_change_send, isOngoing',`
'Attempting to play audio for notification type 1' | Select-Object -Last 1

# Get Teams application process
$TeamsProcess = Get-Process -Name Teams -ErrorAction SilentlyContinue
Expand Down Expand Up @@ -110,6 +111,10 @@ Get-Content -Path "C:\Users\$env:USERNAME\AppData\Roaming\Microsoft\Teams\logs.t
$Activity = $taInACall
$ActivityIcon = $iconInACall
}
ElseIf ($TeamsActivity -like "*Attempting to play audio for notification type 1*") {
$Activity = $taIncomingCall
$ActivityIcon = $iconInACall
}
}
}
# Set status to Offline when the Teams application is not running
Expand Down
1 change: 1 addition & 0 deletions Lang-en.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# sensor.teams_activity
$taNotInACall = "Not in a call"
$taIncomingCall = "Incoming call"
$taInACall = "In a call"

# sensor.teams_status
Expand Down
1 change: 1 addition & 0 deletions Lang-nl.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# sensor.teams_activity
$taNotInACall = "Niet in gesprek"
$taIncomingCall = "Binnenkomend telefoongesprek"
$taInACall = "In gesprek"

# sensor.teams_status
Expand Down
4 changes: 2 additions & 2 deletions Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ $settingsHAUrl = "<HAUrl>" # Example: https://yourha.duckdns.org or http://192.1
$Lang = "en"

# Set icons to use for call activity
$iconInACall = "mdi:phone-in-talk-outline"
$iconInACall = "mdi:phone-in-talk"
$iconIncomingCall = "mdi:phone-incoming"
$iconNotInACall = "mdi:phone-off"
$iconMonitoring = "mdi:api"

# Set entities to post to
# Friendly names are required or they get reset in HA through the API...
Expand Down

0 comments on commit 03a17d4

Please sign in to comment.