2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-20 19:36:02 +00:00

YAMAHA_AVR: fix missing readings in tuner mode DAB (Forum: #76789)

git-svn-id: https://svn.fhem.de/fhem/trunk@15158 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
markusbloch 2017-10-01 09:39:51 +00:00
parent 60ff65f1c6
commit 5e6e044d71

View File

@ -1817,7 +1817,7 @@ YAMAHA_AVR_ParseResponse($$$)
{ {
readingsBulkUpdate($hash, "currentStation", YAMAHA_AVR_html2txt($1)); readingsBulkUpdate($hash, "currentStation", YAMAHA_AVR_html2txt($1));
} }
elsif($data =~ /<Meta_Info>.*?<DAB>.*?<Service_Label>(.+?)<\/Service_Label>.*?<\/DAB>.*?<\/Meta_Info>/) elsif($data =~ /<DAB>.*?<Meta_Info>.*?<Service_Label>(.+?)<\/Service_Label>.*?<\/Meta_Info>.*?<\/DAB>/)
{ {
readingsBulkUpdate($hash, "currentStation", YAMAHA_AVR_html2txt($1)); readingsBulkUpdate($hash, "currentStation", YAMAHA_AVR_html2txt($1));
} }
@ -1889,12 +1889,12 @@ YAMAHA_AVR_ParseResponse($$$)
readingsBulkUpdate($hash, "playStatus", "playing"); readingsBulkUpdate($hash, "playStatus", "playing");
} }
if($data =~ /<Tuning>.*?<Freq>(?:<Current>)?<Val>(\d+?)<\/Val><Exp>(\d+?)<\/Exp><Unit>(.*?)<\/Unit>(?:<\/Current>)?.*<\/Tuning>/ or (YAMAHA_AVR_isModel_DSP($hash) and $data =~ /<Tuning>.*?<Freq><Val>(\d+?)<\/Val><Exp>(\d+?)<\/Exp><Unit>(.*?)<\/Unit><\/Freq>.*?<\/Tuning>/)) if($data =~ /<Tuning>.*?<Freq>(?:<Current>)?<Val>(\d+?)<\/Val><Exp>(\d+?)<\/Exp><Unit>(.*?)<\/Unit>(?:<\/Current>)?.*<\/Tuning>/ or $data =~ /<DAB>.*?<Signal_Info>.*?<Freq><Val>(\d+?)<\/Val><Exp>(\d+?)<\/Exp><Unit>(.*?)<\/Unit><\/Freq>.*<\/Signal_Info>.*<\/DAB>/ or(YAMAHA_AVR_isModel_DSP($hash) and $data =~ /<Tuning>.*?<Freq><Val>(\d+?)<\/Val><Exp>(\d+?)<\/Exp><Unit>(.*?)<\/Unit><\/Freq>.*?<\/Tuning>/))
{ {
readingsBulkUpdate($hash, "currentStationFrequency", sprintf("%.$2f", ($1 / (10 ** $2)))." $3"); readingsBulkUpdate($hash, "currentStationFrequency", sprintf("%.$2f", ($1 / (10 ** $2)))." $3");
readingsBulkUpdate($hash, "tunerFrequency", sprintf("%.$2f", ($1 / (10 ** $2)))); readingsBulkUpdate($hash, "tunerFrequency", sprintf("%.$2f", ($1 / (10 ** $2))));
if($data =~ /<Tuning>.*?<Band>(.+?)<\/Band>.*?<\/Tuning>/) if($data =~ /<(?:Tuning|DAB)>.*?<Band>(.+?)<\/Band>.*?<\/(?:Tuning|DAB)>/)
{ {
readingsBulkUpdate($hash, "tunerFrequencyBand", uc($1)); readingsBulkUpdate($hash, "tunerFrequencyBand", uc($1));
} }