mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-16 04:36:02 +00:00
71_YAMAHA_NP.pm: Make timer setting more convenient.
git-svn-id: https://svn.fhem.de/fhem/trunk@7694 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
b5b0b0af04
commit
7fdd194895
@ -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.
|
||||
- feature: 71_YAMAHA_NP.pm: Make timer setting more convenient.
|
||||
- changed: FB_CALLMONITOR: allow chars in phone numbers for reverse search
|
||||
- changed: SYSMON: non-blocking
|
||||
- changed: 71_YAMAHA_NP.pm: Provide entire http link to Player AlbumArt.
|
||||
|
@ -181,6 +181,7 @@ sub YAMAHA_NP_Set
|
||||
"on:noArg ".
|
||||
"off:noArg ".
|
||||
"timerRepeat:once,every ".
|
||||
"timerSet:noArg ".
|
||||
"sleep:off,30min,60min,90min,120min ".
|
||||
"volumeStraight:slider,".$volumeStraightMin.",1,".$volumeStraightMax." ".
|
||||
"volume:slider,0,1,100 ".
|
||||
@ -207,6 +208,7 @@ sub YAMAHA_NP_Set
|
||||
"on:noArg ".
|
||||
"off:noArg ".
|
||||
"timerRepeat:once,every ".
|
||||
"timerSet:noArg ".
|
||||
"sleep:off,30min,60min,90min,120min ".
|
||||
"volumeStraight:slider,".$volumeStraightMin.",1,".$volumeStraightMax." ".
|
||||
"volume:slider,0,1,100 ".
|
||||
@ -511,17 +513,7 @@ sub YAMAHA_NP_Set
|
||||
{
|
||||
if($a[2] eq "on")
|
||||
{
|
||||
if(defined($hash->{helper}{timerHour}) and defined($hash->{helper}{timerMinute}) and defined($hash->{helper}{timerRepeat}) and defined($hash->{helper}{timerVolume}))
|
||||
{
|
||||
# Configure Timer according to provided parameters
|
||||
YAMAHA_NP_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><System><Misc><Timer><Param><Start_Time>".sprintf("%02d", $hash->{helper}{timerHour}).":".sprintf("%02d", $hash->{helper}{timerMinute})."</Start_Time><Volume>".$hash->{helper}{timerVolume}."</Volume><Repeat>".$hash->{helper}{timerRepeat}."</Repeat></Param></Timer></Misc></System></YAMAHA_AV>", $what, $a[2]);
|
||||
# Switch on timer
|
||||
YAMAHA_NP_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><System><Misc><Timer><Mode>".ucfirst($a[2])."</Mode></Timer></Misc></System></YAMAHA_AV>", $what, $a[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Please, define timerHour, timerMinute, timerRepeat and timerVolume first."
|
||||
}
|
||||
YAMAHA_NP_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><System><Misc><Timer><Mode>".ucfirst($a[2])."</Mode></Timer></Misc></System></YAMAHA_AV>", $what, $a[2]);
|
||||
}
|
||||
elsif($a[2] eq "off")
|
||||
{
|
||||
@ -577,6 +569,18 @@ sub YAMAHA_NP_Set
|
||||
return "Please use straight device volume range :".$hash->{helper}{VOLUMESTRAIGHTMIN}."...".$hash->{helper}{VOLUMESTRAIGHTMAX}.".";
|
||||
}
|
||||
}
|
||||
elsif($what eq "timerSet")
|
||||
{
|
||||
if(defined($hash->{helper}{timerHour}) and defined($hash->{helper}{timerMinute}) and defined($hash->{helper}{timerRepeat}) and defined($hash->{helper}{timerVolume}))
|
||||
{
|
||||
# Configure Timer according to provided parameters
|
||||
YAMAHA_NP_SendCommand($hash, "<YAMAHA_AV cmd=\"PUT\"><System><Misc><Timer><Param><Start_Time>".sprintf("%02d", $hash->{helper}{timerHour}).":".sprintf("%02d", $hash->{helper}{timerMinute})."</Start_Time><Volume>".$hash->{helper}{timerVolume}."</Volume><Repeat>".$hash->{helper}{timerRepeat}."</Repeat></Param></Timer></Misc></System></YAMAHA_AV>", $what, $a[2]);
|
||||
}
|
||||
else
|
||||
{
|
||||
return "Please, define timerHour, timerMinute, timerRepeat and timerVolume first.";
|
||||
}
|
||||
}
|
||||
elsif($what eq "tunerPresetDAB")
|
||||
{
|
||||
if($a[2] >= 1 and $a[2] <= 30 and $hash->{MODEL} eq "CRX-N560D")
|
||||
@ -705,15 +709,12 @@ sub YAMAHA_NP_Undefine
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
############################################################################################################
|
||||
#
|
||||
# Begin of helper functions
|
||||
#
|
||||
############################################################################################################
|
||||
|
||||
|
||||
|
||||
#############################
|
||||
# sends a command to the receiver via HTTP
|
||||
sub YAMAHA_NP_SendCommand
|
||||
@ -1469,8 +1470,9 @@ sub YAMAHA_NP_html2txt
|
||||
<li><b>timerHour</b> [0...23] - sets hour of device's internal wake-up timer</li>
|
||||
<li><b>timerMinute</b> [0...59] - sets minutes of device's internal wake-up timer</li>
|
||||
<li><b>timerRepeat</b> [once|every] - sets repetition mode of device's internal wake-up timer</li>
|
||||
<li><b>timerSet</b> - configures the timer according to timerHour, timerMinute, timerRepeat, timerVolume. (ALL parameters must be set before. This command does not switch on the timer. → 'timer on'.)</li>
|
||||
<li><b>timerVolume</b> [<VOL_MIN>...<VOL_MAX>] - sets volume of device's internal wake-up timer</li>
|
||||
<li><b>timer</b> [on|off] - sets device's internal wake-up timer. <i>(Note: before timer activation timerHour, timerMinute, timerRepeat and timerVolume must be set.)</i></li>
|
||||
<li><b>timer</b> [on|off] - sets device's internal wake-up timer. <i>(Note: The timer will be activated according to the last stored timer parameters in the device. In order to modify please use the 'timerSet' command.)</i></li>
|
||||
<li><b>tuner [<parameter>] </b> - sets tuner related commands.</li>
|
||||
<ul>
|
||||
<li><b>bandDAB</b> - sets the tuner band to DAB (if available).</li>
|
||||
@ -1696,8 +1698,9 @@ sub YAMAHA_NP_html2txt
|
||||
<li><b>timerHour</b> [0...23] - Setzt die Stunde des internen Wake-up Timers</li>
|
||||
<li><b>timerMinute</b> [0...59] - Setzt die Minute des internen Wake-up Timers</li>
|
||||
<li><b>timerRepeat</b> [once|every] - Setzt den Wiederholungsmodus des internen Wake-up Timers</li>
|
||||
<li><b>timerSet</b> - konfiguriert den Timer nach den Vorgaben: timerHour, timerMinute, timerRepeat, timerVolume. (ALLE Paremeter müssen zuvor gesetzt werden. Dieser Befehl schaltet den Timer nicht ein → 'timer on'.)</li>
|
||||
<li><b>timerVolume</b> [<VOL_MIN>...<VOL_MAX>] - Setzt die Lautstärke des internen Wake-up Timers</li>
|
||||
<li><b>timer</b> [on|off] - Schaltet ein/aus den internen Wake-up Timer. <i>(Bemerkung: Bevor der Wake-Up Timer gesetzt werden kann, müssen timerHour, timerMinute, timerRepeat and timerVolume zuvor gesetzt werden.)</i></li>
|
||||
<li><b>timer</b> [on|off] - Schaltet ein/aus den internen Wake-up Timer. <i>(Bemerkung: Der Timer wird basierend auf den im Gerät gespeicherten Parametern aktiviert. Um diese zu ändern, bitte den 'timerSet' Befehl benutzen.)</i></li>
|
||||
<li><b>tuner [<parameter>] </b> - Tuner-relevante Befehle.</li>
|
||||
<ul>
|
||||
<li><b>bandDAB</b> - Setzt das Tuner-Band auf DAB (falls verfügbar).</li>
|
||||
|
Loading…
x
Reference in New Issue
Block a user