From 25a79d0972e1ebb33fbb39b41cdc8e3d99bb070c Mon Sep 17 00:00:00 2001
From: markusbloch <>
Date: Sat, 6 May 2017 12:08:19 +0000
Subject: [PATCH] YAMAHA_AVR: change values of reading "playStatus" values
according to FHEM development guidelines AV (Forum: #60902)
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@14207 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
CHANGED | 2 ++
FHEM/71_YAMAHA_AVR.pm | 13 ++++++++++---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/CHANGED b/CHANGED
index a800a4897..5dfd5f939 100644
--- a/CHANGED
+++ b/CHANGED
@@ -1,5 +1,7 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
+ - change: 71_YAMAHA_AVR: changing values of reading values conform
+ to FHEM AV guidelines ("stopped", "playing" or "paused")
- bugfix 73_km200.pm: Errorlist unsorted timestamp part 3
- bugfix: 76_SMAInverter: version 2.9.1, issues for some inverter types
e.g. SunnyBoy systems
diff --git a/FHEM/71_YAMAHA_AVR.pm b/FHEM/71_YAMAHA_AVR.pm
index 16a9ccbfb..fb24c706a 100755
--- a/FHEM/71_YAMAHA_AVR.pm
+++ b/FHEM/71_YAMAHA_AVR.pm
@@ -1643,7 +1643,7 @@ YAMAHA_AVR_ParseResponse($$$)
{
Log3 $name, 4, "YAMAHA_AVR ($name) - check for extended input informations on <$1>";
- YAMAHA_AVR_SendCommand($hash, "<$1>GetParam$1>", "statusRequest", "playInfo", {options => {can_fail => 1}});
+ YAMAHA_AVR_SendCommand($hash, "<$1>GetParam$1>", "statusRequest", "playInfo", {options => {can_fail => 1, input_tag => $1}});
if(!exists($hash->{helper}{LAST_INPUT_TAG}) or ($hash->{helper}{LAST_INPUT_TAG} ne $hash->{helper}{CURRENT_INPUT_TAG}) or $hash->{helper}{SUPPORT_SHUFFLE_REPEAT})
{
@@ -1667,6 +1667,7 @@ YAMAHA_AVR_ParseResponse($$$)
readingsBulkUpdateIfChanged($hash, "currentStation", "");
readingsBulkUpdateIfChanged($hash, "currentStationFrequency","");
readingsBulkUpdateIfChanged($hash, "currentArtist", "");
+ readingsBulkUpdateIfChanged($hash, "playStatus", "stopped");
}
}
@@ -1820,10 +1821,16 @@ YAMAHA_AVR_ParseResponse($$$)
{
readingsBulkUpdateIfChanged($hash, "currentTitle", "");
}
-
+
if($data =~ /(.+?)<\/Playback_Info>/)
{
- readingsBulkUpdate($hash, "playStatus", lc($1));
+ readingsBulkUpdate($hash, "playStatus", "stopped") if($1 eq "Stop");
+ readingsBulkUpdate($hash, "playStatus", "playing") if($1 eq "Play");
+ readingsBulkUpdate($hash, "playStatus", "paused") if($1 eq "Pause");
+ }
+ elsif($options->{input_tag} eq "Tuner")
+ {
+ readingsBulkUpdate($hash, "playStatus", "playing");
}
if($data =~ /.*?(\d+?)<\/Val>(\d+?)<\/Exp>(.*?)<\/Unit><\/Current>.*?<\/Tuning>/ or (YAMAHA_AVR_isModel_DSP($hash) and $data =~ /.*?(\d+?)<\/Val>(\d+?)<\/Exp>(.*?)<\/Unit><\/Freq>.*?<\/Tuning>/))