1
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-05-04 22:19:38 +00:00

YAMAHA_AVR: current* readings will be erased in case they not apply; added currentTitle for input TUNER (by Norbert Wedegaertner)

git-svn-id: https://svn.fhem.de/fhem/trunk@5765 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
markusbloch 2014-05-06 16:59:09 +00:00
parent 44a675f759
commit f14d2ad32e
2 changed files with 58 additions and 30 deletions

View File

@ -1,5 +1,8 @@
# 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.
- feature: YAMAHA_AVR current* readings will be erased in case they
not applicable
- feature: YAMAHA_AVR currentTitle available for TUNER
- feature: new Method: SYSMON_getValues([desired keys])
- feature: JSONMETER: hourly statistics
- feature: configdb: new command search

View File

@ -169,37 +169,62 @@ YAMAHA_AVR_GetStatus($;$)
{
Log3 $name, 4, "YAMAHA_AVR $name: check for extended informations";
my $infos = YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"GET\"><$1><Play_Info>GetParam</Play_Info></$1></YAMAHA_AV>");
my $infos = YAMAHA_AVR_SendCommand($hash, "<YAMAHA_AV cmd=\"GET\"><$1><Play_Info>GetParam</Play_Info></$1></YAMAHA_AV>");
if($infos =~ /<Meta_Info>.*?<Artist>(.+?)<\/Artist>.*?<\/Meta_Info>/)
{
readingsBulkUpdate($hash, "currentArtist", YAMAHA_AVR_html2txt($1));
}
if($infos =~ /<Meta_Info>.*?<Station>(.+?)<\/Station>.*?<\/Meta_Info>/)
{
readingsBulkUpdate($hash, "currentStation", YAMAHA_AVR_html2txt($1));
}
elsif($infos =~ /<Meta_Info>.*?<Program_Service>(.+?)<\/Program_Service>.*?<\/Meta_Info>/)
{
readingsBulkUpdate($hash, "currentStation", YAMAHA_AVR_html2txt($1));
}
if($infos =~ /<Meta_Info>.*?<Channel>(.+?)<\/Channel>.*?<\/Meta_Info>/)
{
readingsBulkUpdate($hash, "currentChannel", $1);
}
if($infos =~ /<Meta_Info>.*?<Album>(.+?)<\/Album>.*?<\/Meta_Info>/)
{
readingsBulkUpdate($hash, "currentAlbum", YAMAHA_AVR_html2txt($1));
}
if($infos =~ /<Meta_Info>.*?<Song>(.+?)<\/Song>.*?<\/Meta_Info>/)
{
readingsBulkUpdate($hash, "currentTitle", YAMAHA_AVR_html2txt($1));
}
if($infos =~ /<Meta_Info>.*?<Artist>(.+?)<\/Artist>.*?<\/Meta_Info>/)
{
readingsBulkUpdate($hash, "currentArtist", YAMAHA_AVR_html2txt($1));
}
else
{
readingsBulkUpdate($hash, "currentArtist", "", 0);
}
if($infos =~ /<Meta_Info>.*?<Station>(.+?)<\/Station>.*?<\/Meta_Info>/)
{
readingsBulkUpdate($hash, "currentStation", YAMAHA_AVR_html2txt($1));
}
elsif($infos =~ /<Meta_Info>.*?<Program_Service>(.+?)<\/Program_Service>.*?<\/Meta_Info>/)
{
readingsBulkUpdate($hash, "currentStation", YAMAHA_AVR_html2txt($1));
}
else
{
readingsBulkUpdate($hash, "currentStation", "", 0);
}
if($infos =~ /<Meta_Info>.*?<Channel>(.+?)<\/Channel>.*?<\/Meta_Info>/)
{
readingsBulkUpdate($hash, "currentChannel", $1);
}
else
{
readingsBulkUpdate($hash, "currentChannel", "", 0);
}
if($infos =~ /<Meta_Info>.*?<Album>(.+?)<\/Album>.*?<\/Meta_Info>/)
{
readingsBulkUpdate($hash, "currentAlbum", YAMAHA_AVR_html2txt($1));
}
else
{
readingsBulkUpdate($hash, "currentAlbum", "", 0);
}
if($infos =~ /<Meta_Info>.*?<Song>(.+?)<\/Song>.*?<\/Meta_Info>/)
{
readingsBulkUpdate($hash, "currentTitle", YAMAHA_AVR_html2txt($1));
}
elsif($infos =~ /<Meta_Info>.*?<Radio_Text_A>(.+?)<\/Radio_Text_A>.*?<\/Meta_Info>/)
{
readingsBulkUpdate($hash, "currentTitle", YAMAHA_AVR_html2txt($1));
}
else
{
readingsBulkUpdate($hash, "currentTitle", "", 0);
}
if($infos =~ /<Playback_Info>(.+?)<\/Playback_Info>/)
{
readingsBulkUpdate($hash, "playStatus", lc($1));