2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

99_sonos2mqttUtils:add toggle to mute

git-svn-id: https://svn.fhem.de/fhem/trunk@24073 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Otto123 2021-03-24 10:42:49 +00:00
parent c088f498f6
commit 0bcbebe992

View File

@ -118,7 +118,8 @@ if($cmd eq 'joinGroup') {return qq($topic { "command": "joingroup", "input": "$
if($cmd eq 'setAVTUri') {return qq($topic { "command": "setavtransporturi", "input": "$payload"})}
if($cmd eq 'notify') {return qq($topic { "command":"notify","input":{"trackUri":"$arr[2]","onlyWhenPlaying":false,"timeout":100,"volume":$arr[1],"delayMs":700}})}
my %t=('true'=>'mute','false'=>'unmute','on'=>'mute','off'=>'unmute');
#my %t=('true'=>'mute','false'=>'unmute','on'=>'mute','off'=>'unmute');
my %t=('true'=>'mute','false'=>'unmute','on'=>'mute','off'=>'unmute','toggle'=>ReadingsVal($NAME,'mute','') eq 'true' ? 'unmute' : 'mute');
if($cmd eq 'mute') {return qq(sonos/$uuid/control { "command": "$t{$payload}" } )}
if($cmd eq 'input') {
$value = $payload eq "TV" ? "tv" : $payload eq "Line_In" ? "line" : "queue";