From a67b50963fdb309bcbfb11a7dea5facc29211cab Mon Sep 17 00:00:00 2001 From: ra666ack Date: Sun, 20 Dec 2015 19:08:47 +0000 Subject: [PATCH] 71_YAMAHA_NP: New Feature added. Direct FM frequency setting. git-svn-id: https://svn.fhem.de/fhem/trunk@10217 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/71_YAMAHA_NP.pm | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/fhem/CHANGED b/fhem/CHANGED index 7686ad682..6de892f3a 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -5,6 +5,7 @@ - bugfix: 49_SSCam: fixed a bug that functions may impact each other - feature: 31_MilightDevice: Add restoreAtStart attribute so group devices (slot 'A') do not restore state by default at startup - bugfix: 30_MilightBridge/31_MilightDevice: Fix startup restore. Fix crash on invalid hostname. + - feature: YAMAHA_NP: Direct FM frequency setting. - feature: 30_pilight_xyz: possibility to change IO-Device (IODEV) - bugfix: YAMAHA_AVR: fixing not correctly volume smoothing - change: 49_SSCam: turned completly to HttpUtils_NonblockingGet for diff --git a/fhem/FHEM/71_YAMAHA_NP.pm b/fhem/FHEM/71_YAMAHA_NP.pm index 17c0492b5..688d2f25d 100644 --- a/fhem/FHEM/71_YAMAHA_NP.pm +++ b/fhem/FHEM/71_YAMAHA_NP.pm @@ -207,6 +207,7 @@ sub YAMAHA_NP_Set "tunerPresetDAB:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 ". "tunerPresetFM:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 ". "timerHour:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 ". + "tunerFMFrequency ". "timerMinute:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59 "; } else @@ -240,6 +241,7 @@ sub YAMAHA_NP_Set "playerListCursorUp:noArg ". "tunerPresetFM:1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30 ". "timerHour:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 ". + "tunerFMFrequency ". "timerMinute:0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59 "; } Log3 $name, 5, "Model: $model."; @@ -692,6 +694,26 @@ sub YAMAHA_NP_Set return $usage; } } + elsif($what eq "tunerFMFrequency") + { + if ( $a[2] =~ /^[0-9,.E]+$/ ) # Check if value is numeric + { + if( $a[2] >= 87.50 and $a[2] <= 108.00) + { + my $frequency = $a[2]; + $frequency =~ s/\.//; # Remove decimal point + YAMAHA_NP_SendCommand($hash, "".$frequency."<\/Freq><\/FM><\/Tuning><\/Play_Control><\/Tuner>", "tunerFMFrequency", $a[2]); + } + else + { + return "Frequency value must be in the range 87.50 ... 108.00 of the format (x)xx.xx" + } + } + else + { + return "Frequency value must be numeric in the range 87.50 ... 108.00 of the format (x)xx.xx" + } + } else { return $usage; @@ -1645,6 +1667,7 @@ sub YAMAHA_NP_html2txt
  • presetUp  -   tuner preset up.
  • presetDown  -   tuner preset down.
  • +
  • tunerFMFrequency [87.50 ... 108.00]   -   Sets the FM frequency. The value must be 87.50 ... 108.00 including the decimal point ('.') with two digits after. Otherwise the value will be ignored.
  • tunerPresetDAB [1...30]   -   Sets the DAB preset.
  • tunerPresetFM [1...30]   -   Sets the FM preset.
  • volume [0...100]   -   set the volume level in %
  • @@ -1894,6 +1917,7 @@ sub YAMAHA_NP_html2txt
  • presetUp  -   Tuner Voreinstellung hoch.
  • presetDown  -   Tuner Voreinstellung runter.
  • +
  • tunerFMFrequency [87.50 ... 108.00]   -   Setzt die FM Frequenz. Der Wert muss zwischen 87.50 ... 108.00 liegen und muss den Digitalpunkt beinhalten ('.') mit zwei Nachkommastellen.
  • tunerPresetDAB [1...30]   -   Setzt die DAB Voreinstellung.
  • tunerPresetFM [1...30]   -   Setzt die FM Voreinstellung.
  • volume [0...100]   -   Setzt den Lautstärkepegel in %