2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

70_XBMC: renamed is3DFile to 3dfile, rounded volume to 2 digits, do not clear readings on stop or exit

git-svn-id: https://svn.fhem.de/fhem/trunk@7662 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
vbs2 2015-01-22 19:39:16 +00:00
parent ad891a9079
commit 27901264ca

View File

@ -178,7 +178,6 @@ sub XBMC_Init($)
{
my ($hash) = @_;
XBMC_ResetMediaReadings($hash);
XBMC_ResetPlayerReadings($hash);
#since we just successfully connected to XBMC I guess its safe to assume the device is awake
@ -486,7 +485,7 @@ sub XBMC_ProcessNotification($$)
#React on volume change - http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v6#Application.OnVolumeChanged
if($obj->{method} eq "Application.OnVolumeChanged") {
readingsBeginUpdate($hash);
readingsBulkUpdate($hash,'volume',$obj->{params}->{data}->{volume});
readingsBulkUpdate($hash,'volume',sprintf("%.2f", $obj->{params}->{data}->{volume}));
readingsBulkUpdate($hash,'mute',($obj->{params}->{data}->{muted} ? 'on' : 'off'));
readingsEndUpdate($hash, 1);
}
@ -506,8 +505,6 @@ sub XBMC_ProcessNotification($$)
Log3($name, 4, "Discard Player.OnSpeedChanged event because it is irrelevant");
}
elsif($obj->{method} eq "Player.OnStop") {
XBMC_ResetMediaReadings($hash);
XBMC_ResetPlayerReadings($hash);
readingsSingleUpdate($hash,"playStatus",'stopped',1);
}
elsif($obj->{method} eq "Player.OnPause") {
@ -522,8 +519,7 @@ sub XBMC_ProcessNotification($$)
if (lc($1) eq "system") {
if ((lc($2) eq "quit") or (lc($2) eq "restart") or (lc($2) eq "sleep")) {
XBMC_ResetMediaReadings($hash);
XBMC_ResetPlayerReadings($hash);
readingsBulkUpdate($hash, "playStatus", "stopped" );
}
if (lc($2) eq "sleep") {