From b8eb0f2f1ddbf0a3fd68d667146836880f12c39e Mon Sep 17 00:00:00 2001 From: markusbloch <> Date: Thu, 29 May 2014 18:59:55 +0000 Subject: [PATCH] YAMAHA_BD: new readings contentType, currentTrack, currentTitle and totalTracks git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@6005 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/71_YAMAHA_BD.pm | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/FHEM/71_YAMAHA_BD.pm b/FHEM/71_YAMAHA_BD.pm index 4f5203f79..1de92b4a1 100755 --- a/FHEM/71_YAMAHA_BD.pm +++ b/FHEM/71_YAMAHA_BD.pm @@ -672,9 +672,29 @@ YAMAHA_BD_ParseResponse($$$) readingsBulkUpdate($hash, "playStatus", lc($1)); } - if($data =~ /(.+?)<\/Chapter>/) + if($data =~ /.*?(.+?)<\/Chapter>.*?<\/Contents>/) { - readingsBulkUpdate($hash, "currentChapter", lc($1)); + readingsBulkUpdate($hash, "currentChapter", $1); + } + + if($data =~ /.*?(.+?)<\/Track>.*?<\/Contents>/) + { + readingsBulkUpdate($hash, "currentTrack", $1); + } + + if($data =~ /.*?(.+?)<\/Title>.*?<\/Contents>/) + { + readingsBulkUpdate($hash, "currentTitle", $1); + } + + if($data =~ /<Disc_Info>.*?<Track_Num>(.+?)<\/Track_Num>.*?<\/Disc_Info>/) + { + readingsBulkUpdate($hash, "totalTracks", $1); + } + + if($data =~ /<Contents>.*?<Type>(.+?)<\/Type>.*?<\/Contents>/) + { + readingsBulkUpdate($hash, "contentType", lc($1)); } if($data =~ /<File_Name>(.+?)<\/File_Name>/) @@ -923,6 +943,7 @@ sub YAMAHA_BD_formatTimestamp($) <ul> <li><b>input</b> - The current playback source (can be "DISC", "USB" or "Network")</li> <li><b>discType</b> - The current type of disc, which is inserted (e.g. "No Disc", "CD", "DVD", "BD",...)</li> + <li><b>contentType</b> - The current type of content, which is played (e.g. "audio", "video", "photo" or "no contents")</li> <li><b>error</b> - indicates an hardware error of the player (can be "none", "fan error" or "usb overcurrent")</li> <li><b>power</b> - Reports the power status of the player or zone (can be "on" or "off")</li> <li><b>presence</b> - Reports the presence status of the player or zone (can be "absent" or "present"). In case of an absent device, it cannot be controlled via FHEM anymore.</li> @@ -932,9 +953,12 @@ sub YAMAHA_BD_formatTimestamp($) <br><br><u>Input dependent Readings/Events:</u><br> <li><b>currentChapter</b> - Number of the current DVD/BD Chapter (only at DVD/BD's)</li> <li><b>currentMedia</b> - Name of the current file (only at USB)</li> + <li><b>currentTrack</b> - Number of the current CD-Audio title (only at CD-Audio)</li> + <li><b>currentTitle</b> - Number of the current title (only at DVD/BD's)</li> <li><b>playTimeCurrent</b> - current timecode of played media</li> <li><b>playTimeTotal</b> - the total time of the current movie (only at DVD/BD's)</li> <li><b>playStatus</b> - indicates if the player plays media or not (can be "play", "pause", "stop", "fast fwd", "fast rev", "slow fwd", "slow rev")</li> + <li><b>totalTracks</b> - The number of total tracks on inserted CD-Audio</li> </ul> <br> <b>Implementator's note</b><br> @@ -1099,6 +1123,7 @@ sub YAMAHA_BD_formatTimestamp($) <ul> <li><b>input</b> - Die aktuelle Wiedergabequelle ("DISC", "USB" oder "Network")</li> <li><b>discType</b> - Die Art der eingelegten Disc (z.B "No Disc" => keine Disc eingelegt, "CD", "DVD", "BD",...)</li> + <li><b>contentType</b> - Die Art des Inhaltes, der gerade abgespielt wird ("audio", "video", "photo" oder "no contents")</li> <li><b>error</b> - zeigt an, ob ein interner Fehler im Player vorliegt ("none" => kein Fehler, "fan error" => Lüfterdefekt, "usb overcurrent" => USB Spannungsschutz)</li> <li><b>power</b> - Der aktuelle Betriebsstatus ("on" => an, "off" => aus)</li> <li><b>presence</b> - Die aktuelle Empfangsbereitschaft ("present" => empfangsbereit, "absent" => nicht empfangsbereit, z.B. Stromausfall)</li> @@ -1107,10 +1132,13 @@ sub YAMAHA_BD_formatTimestamp($) <li><b>state</b> - Der aktuelle Schaltzustand (power-Reading) oder die Abwesenheit des Gerätes (mögliche Werte: "on", "off" oder "absent")</li> <br><br><u>Quellenabhängige Readings/Events:</u><br> <li><b>currentChapter</b> - Das aktuelle Kapitel eines DVD- oder Blu-Ray-Films</li> + <li><b>currentTitle</b> - Die Titel-Nummer des aktuellen DVD- oder Blu-Ray-Films</li> + <li><b>currentTrack</b> - Die aktuelle Track-Nummer der wiedergebenden Audio-CD</li> <li><b>currentMedia</b> - Der Name der aktuell wiedergebenden Datei (Nur bei der Wiedergabe über USB)</li> <li><b>playTimeCurrent</b> - Der aktuelle Timecode an dem sich die Wiedergabe momentan befindet.</li> <li><b>playTimeTotal</b> - Die komplette Spieldauer des aktuellen Films (Nur bei der Wiedergabe von DVD/BD's)</li> <li><b>playStatus</b> - Wiedergabestatus des aktuellen Mediums</li> + <li><b>totalTracks</b> - Gesamtanzahl aller Titel einer Audio-CD</li> </ul> <br> <b>Hinweise des Autors</b>