mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-07 16:59:18 +00:00
YAMAHA_AVR: replace html entities with the original characters
git-svn-id: https://svn.fhem.de/fhem/trunk@4658 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
87f15faa7e
commit
9c199cf403
@ -164,16 +164,16 @@ YAMAHA_AVR_GetStatus($;$)
|
||||
|
||||
if($infos =~ /<Meta_Info>.*?<Artist>(.+?)<\/Artist>.*?<\/Meta_Info>/)
|
||||
{
|
||||
readingsBulkUpdate($hash, "currentArtist", $1);
|
||||
readingsBulkUpdate($hash, "currentArtist", YAMAHA_AVR_html2txt($1));
|
||||
}
|
||||
|
||||
if($infos =~ /<Meta_Info>.*?<Station>(.+?)<\/Station>.*?<\/Meta_Info>/)
|
||||
{
|
||||
readingsBulkUpdate($hash, "currentStation", $1);
|
||||
readingsBulkUpdate($hash, "currentStation", YAMAHA_AVR_html2txt($1));
|
||||
}
|
||||
elsif($infos =~ /<Meta_Info>.*?<Program_Service>(.+?)<\/Program_Service>.*?<\/Meta_Info>/)
|
||||
{
|
||||
readingsBulkUpdate($hash, "currentStation", $1);
|
||||
readingsBulkUpdate($hash, "currentStation", YAMAHA_AVR_html2txt($1));
|
||||
}
|
||||
|
||||
if($infos =~ /<Meta_Info>.*?<Channel>(.+?)<\/Channel>.*?<\/Meta_Info>/)
|
||||
@ -183,12 +183,12 @@ YAMAHA_AVR_GetStatus($;$)
|
||||
|
||||
if($infos =~ /<Meta_Info>.*?<Album>(.+?)<\/Album>.*?<\/Meta_Info>/)
|
||||
{
|
||||
readingsBulkUpdate($hash, "currentAlbum", $1);
|
||||
readingsBulkUpdate($hash, "currentAlbum", YAMAHA_AVR_html2txt($1));
|
||||
}
|
||||
|
||||
if($infos =~ /<Meta_Info>.*?<Song>(.+?)<\/Song>.*?<\/Meta_Info>/)
|
||||
{
|
||||
readingsBulkUpdate($hash, "currentTitle", $1);
|
||||
readingsBulkUpdate($hash, "currentTitle", YAMAHA_AVR_html2txt($1));
|
||||
}
|
||||
|
||||
if($infos =~ /<Playback_Info>(.+?)<\/Playback_Info>/)
|
||||
@ -995,8 +995,7 @@ sub YAMAHA_AVR_getInputs($)
|
||||
}
|
||||
|
||||
#############################
|
||||
sub
|
||||
YAMAHA_AVR_ResetTimer($;$)
|
||||
sub YAMAHA_AVR_ResetTimer($;$)
|
||||
{
|
||||
my ($hash, $interval) = @_;
|
||||
|
||||
@ -1017,6 +1016,26 @@ YAMAHA_AVR_ResetTimer($;$)
|
||||
|
||||
}
|
||||
|
||||
sub YAMAHA_AVR_html2txt($)
|
||||
{
|
||||
|
||||
my ($string) = @_;
|
||||
|
||||
$string =~ s/ / /g;
|
||||
$string =~ s/&/&/g;
|
||||
$string =~ s/(\xe4|ä)/ä/g;
|
||||
$string =~ s/(\xc4|Ä)/Ä/g;
|
||||
$string =~ s/(\xf6|ö)/ö/g;
|
||||
$string =~ s/(\xd6|Ö)/Ö/g;
|
||||
$string =~ s/(\xfc|ü)/ü/g;
|
||||
$string =~ s/(\xdc|Ü)/Ü/g;
|
||||
$string =~ s/(\xdf|ß)/ß/g;
|
||||
$string =~ s/<.+?>//g;
|
||||
$string =~ s/(^\s+|\s+$)//g;
|
||||
|
||||
return $string;
|
||||
|
||||
}
|
||||
1;
|
||||
|
||||
=pod
|
||||
|
Loading…
x
Reference in New Issue
Block a user