2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-10 01:55:38 +00:00

YAMAHA_AVR: generate readings for tuner in DAB mode (Forum: #76789)

git-svn-id: https://svn.fhem.de/fhem/trunk@15139 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
markusbloch 2017-09-26 09:09:28 +00:00
parent 03c8f46e83
commit 9391b7e3a8
2 changed files with 13 additions and 3 deletions

View File

@ -1,5 +1,6 @@
# 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.
- bugfix: 71_YAMAHA_AVR: generate readings for tuner in DAB mode
- bugfix: 93_DbLog: V2.22.7, bugfix in configCheck for PostgreSQL
- feature: 10_MYSENSORS_DEVICE: updated to latest MYSENSORS version
- feature: 50_TelegramBot: hide cmd in favorites/changed favorites confirm

View File

@ -58,6 +58,7 @@ YAMAHA_AVR_Initialize($)
"disable:0,1 ".
"disabledForIntervals ".
"request-timeout:1,2,3,4,5 ".
"radioTitleDelimiter ".
"model ".
"volumeSteps:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20 ".
"volumeMax ".
@ -1816,6 +1817,10 @@ YAMAHA_AVR_ParseResponse($$$)
{
readingsBulkUpdate($hash, "currentStation", YAMAHA_AVR_html2txt($1));
}
elsif($data =~ /<Meta_Info>.*?<DAB>.*?<Service_Label>(.+?)<\/Service_Label>.*?<\/DAB>.*?<\/Meta_Info>/)
{
readingsBulkUpdate($hash, "currentStation", YAMAHA_AVR_html2txt($1));
}
else
{
readingsBulkUpdateIfChanged($hash, "currentStation", "");
@ -1852,8 +1857,8 @@ YAMAHA_AVR_ParseResponse($$$)
my $tmp = $1;
if($data =~ /<Meta_Info>.*?<Radio_Text_A>(.+?)<\/Radio_Text_A>.*?<Radio_Text_B>(.+?)<\/Radio_Text_B>.*?<\/Meta_Info>/)
{
readingsBulkUpdate($hash, "currentTitle", YAMAHA_AVR_html2txt($1." ".$2));
{
readingsBulkUpdate($hash, "currentTitle", YAMAHA_AVR_html2txt(trim($1)." ".trim($2)));
}
else
{
@ -1864,6 +1869,10 @@ YAMAHA_AVR_ParseResponse($$$)
{
readingsBulkUpdate($hash, "currentTitle", YAMAHA_AVR_html2txt($1));
}
elsif($data =~ /<DAB>.*?<DLS>(.+?)<\/DLS>.*?<\/DAB>/)
{
readingsBulkUpdate($hash, "currentTitle", YAMAHA_AVR_html2txt($1));
}
else
{
readingsBulkUpdateIfChanged($hash, "currentTitle", "");
@ -1880,7 +1889,7 @@ YAMAHA_AVR_ParseResponse($$$)
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 (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, "tunerFrequency", sprintf("%.$2f", ($1 / (10 ** $2))));