diff --git a/fhem/CHANGED b/fhem/CHANGED index a72422360..4a6aa36a4 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # 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: new set command presetUp and presetDown for preset + selection in the current input - added: 52_I2C_GY30_BH1750FVI: modul i2c light intensity sensor - added: 52_I2C_HDC1008: modul for i2c humidity and temperature sensor - bugfix: FB_CALLLIST: fixing double space in certain call state values. diff --git a/fhem/FHEM/71_YAMAHA_AVR.pm b/fhem/FHEM/71_YAMAHA_AVR.pm index c6d579ee9..29b4989dd 100755 --- a/fhem/FHEM/71_YAMAHA_AVR.pm +++ b/fhem/FHEM/71_YAMAHA_AVR.pm @@ -301,7 +301,7 @@ YAMAHA_AVR_Set($@) ((exists($hash->{ACTIVE_ZONE}) and $hash->{ACTIVE_ZONE} eq "mainzone") ? "straight:on,off 3dCinemaDsp:off,auto adaptiveDrc:off,auto ". (exists($hash->{helper}{DIRECT_TAG}) ? "direct:on,off " : ""). (exists($hash->{helper}{DSP_MODES}) ? "dsp:".$dsp_modes_comma." " : "")."enhancer:on,off " : ""). - (exists($hash->{helper}{CURRENT_INPUT_TAG}) ? "navigateListMenu play:noArg pause:noArg stop:noArg skip:reverse,forward preset: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 ". + (exists($hash->{helper}{CURRENT_INPUT_TAG}) ? "navigateListMenu play:noArg pause:noArg stop:noArg skip:reverse,forward preset: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 presetUp:noArg presetDown:noArg ". (($hash->{helper}{SUPPORT_SHUFFLE_REPEAT}) ? "shuffle:on,off repeat:off,one,all " : "") : ""). "sleep:off,30min,60min,90min,120min,last ". (($hash->{helper}{SUPPORT_TONE_STATUS} and exists($hash->{ACTIVE_ZONE}) and $hash->{ACTIVE_ZONE} eq "mainzone") ? "bass:slider,-6,0.5,6 treble:slider,-6,0.5,6 " : ""). @@ -780,6 +780,16 @@ YAMAHA_AVR_Set($@) YAMAHA_AVR_SendCommand($hash, "<$zone>GetParam", "statusRequest", "basicStatus", {options => {no_playinfo => 1}}); YAMAHA_AVR_SendCommand($hash, "<[CURRENT_INPUT_TAG]>".$a[2]."", $what, $a[2], {options => {can_fail => 1}}); } + elsif($what eq "presetUp") + { + YAMAHA_AVR_SendCommand($hash, "<$zone>GetParam", "statusRequest", "basicStatus", {options => {no_playinfo => 1}}); + YAMAHA_AVR_SendCommand($hash, "<[CURRENT_INPUT_TAG]>Up", $what, $a[2], {options => {can_fail => 1}}); + } + elsif($what eq "presetDown") + { + YAMAHA_AVR_SendCommand($hash, "<$zone>GetParam", "statusRequest", "basicStatus", {options => {no_playinfo => 1}}); + YAMAHA_AVR_SendCommand($hash, "<[CURRENT_INPUT_TAG]>Down", $what, $a[2], {options => {can_fail => 1}}); + } elsif($what eq "skip" and defined($a[2])) { if($a[2] eq "forward") @@ -923,6 +933,34 @@ YAMAHA_AVR_Undefine($$) # ############################################################################################################ +# +# Structure of a request hash +# =========================== +# +# { +# data => XML data to send without prefix +# cmd => name of the command which is related to the request +# arg => optional argument related to the command and request +# original_hash => $hash of the originating definition. must be set, if a zone definition sends a request via the mainzones command queue. +# options => optional values, see following list of possibilities. +# } +# +# following option values can be used to control the execution of the command: +# +# { +# unless_in_queue => don't insert the command if an equivalent command already exists in the queue. (flag: 0,1 - default: 0) +# priority => integer value of priority. lower values will be executed before higher values in the appropriate order. (integer value - default value: 3) +# at_first => insert the command at the beginning of the queue, not at the end. (flag: 0,1 - default: 0) +# not_before => don't execute the command before the given Unix timestamp is reached (integer/float value) +# can_fail => the request can return an error. If this flag is set, don't treat this as an communication error, ignore it instead. (flag: 0,1 - default: 0) +# no_playinfo => (only relevant for "statusRequest basicStatus") - don't retrieve extended playback information, after receiving a successful response (flag: 0,1 - default: 0) +# init => (only relevant for navigateListMenu) - marks the initial request to obtain the current menu level (flag: 0,1 - default: 0) +# last_layer => (only relevant for navigateListMenu) - the menu layer that was reached within the last request (integer value) +# item_selected => (only relevant for navigateListMenu) - is set, when the final item is going to be selected with the current request. (flag: 0,1 - default: 0) +# volume_target => (only relevant for volume) - the target volume, that should be reached by smoothing. (float value) +# volume_diff => (only relevant for volume) - the volume difference between each step to reach the target volume (float value) +# } +# ############################# @@ -1132,7 +1170,7 @@ sub YAMAHA_AVR_getNextRequestHash($) ############################# # parses the receiver response sub -YAMAHA_AVR_ParseResponse ($$$) +YAMAHA_AVR_ParseResponse($$$) { my ( $param, $err, $data ) = @_; @@ -1673,7 +1711,7 @@ YAMAHA_AVR_ParseResponse ($$$) $menu_status = $1; } - my $last = ($param->{last_menu_item} or ($menu_layer == ($#list_cmds + 1))); + my $last = ($options->{last_menu_item} or ($menu_layer == ($#list_cmds + 1))); if($menu_status eq "Ready") { @@ -1742,7 +1780,7 @@ YAMAHA_AVR_ParseResponse ($$$) { # list must be checked again in 1 second. Log3 $name, 5 ,"YAMAHA_AVR ($name) - menu is busy. retrying in 1 second"; - YAMAHA_AVR_SendCommand($hash,"<[CURRENT_INPUT_TAG]>GetParam", $cmd, $arg,{options => {not_before => (gettimeofday()+1), last_layer => $menu_layer, at_first => 1}}); + YAMAHA_AVR_SendCommand($hash,"<[CURRENT_INPUT_TAG]>GetParam", $cmd, $arg, {options => {not_before => (gettimeofday()+1), last_layer => $menu_layer, at_first => 1}}); } } } @@ -2151,9 +2189,11 @@ YAMAHA_AVR_isModel_DSP($)
  • 3dCinemaDsp auto|off   -   controls the CINEMA DSP 3D mode
  • adaptiveDrc auto|off   -   controls the Adaptive DRC
  • partyMode on|off   -  controls the party mode. In Main Zone the whole party mode is enabled/disabled system wide. In each zone executed, it enables/disables the current zone from party mode.
  • -
  • navigateListMenu [item1]/[item2]/[itemN]/...   -   select a specific item within a menu structure. for menu-based inputs (e.g. Net Radio, USB, Server, ...) only. See chapter Automatic Menu Navigation for further details and examples.
  • +
  • navigateListMenu [item1]/[item2]/.../[itemN]   -   select a specific item within a menu structure. for menu-based inputs (e.g. Net Radio, USB, Server, ...) only. See chapter Automatic Menu Navigation for further details and examples.
  • tunerFrequency [frequency] [AM|FM]   -   sets the tuner frequency. The first argument is the frequency, second parameter is optional to set the tuner band (AM or FM, default: FM). Depending which tuner band you select, the frequency is given in kHz (AM band) or MHz (FM band). If the second parameter is not set, the FM band will be used. This command can be used even the current input is not "tuner", the new frequency is set and will be played, when the tuner gets active.
  • preset 1...40   -   selects a saved preset of the currently selected input.
  • +
  • presetUp   -   selects the next preset of the currently selected input.
  • +
  • presetDown   -   selects the previous preset of the currently selected input.
  • straight on|off   -   bypasses the internal codec converter and plays the original sound codec
  • direct on|off   -   bypasses all internal sound enhancement features and plays the sound straight directly
  • sleep off,30min,60min,...,last   -   activates the internal sleep timer
  • @@ -2200,7 +2240,7 @@ YAMAHA_AVR_isModel_DSP($) Automatic Menu Navigation (only for menu based inputs like Net Radio, Server, USB, ...)