mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-13 05:06:35 +00:00
90_at.pm: add modifyTimeSpec command for at.
git-svn-id: https://svn.fhem.de/fhem/trunk@8057 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
b0c66e58d8
commit
0a77b7d67c
10
fhem/CHANGED
10
fhem/CHANGED
@ -1,6 +1,8 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# 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.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
- added: New module 71_PHILIPS_AUDIO.pm for Philips MCi, Streamium and Fidelio devices.
|
- feature: set command modifyTimeSpec for at, to be used in webCmd
|
||||||
|
- added: New module 71_PHILIPS_AUDIO.pm for Philips MCi, Streamium and
|
||||||
|
Fidelio devices.
|
||||||
- bugfix: FB_CALLMONITOR: fixed reverse-search for search.ch
|
- bugfix: FB_CALLMONITOR: fixed reverse-search for search.ch
|
||||||
- feature: help is now a separate module
|
- feature: help is now a separate module
|
||||||
- feature: pahColor() added to Color.pm to convert temperatures
|
- feature: pahColor() added to Color.pm to convert temperatures
|
||||||
@ -65,9 +67,9 @@
|
|||||||
- feature: 70_XBMC.pm: clear readings when stopping media
|
- feature: 70_XBMC.pm: clear readings when stopping media
|
||||||
- feature: 70_XBMC.pm: new reading is3DFile for 3D files
|
- feature: 70_XBMC.pm: new reading is3DFile for 3D files
|
||||||
- bugfix: 70_XBMC.pm: improved JSON separator
|
- bugfix: 70_XBMC.pm: improved JSON separator
|
||||||
- added 73_km200: More services added.
|
- added: 73_km200: More services added.
|
||||||
- changed 73_km200: Fhem get-command is able to return raw.
|
- changed: 73_km200: Fhem get-command is able to return raw.
|
||||||
- bugfix 73_km200: Handling of unknown attributes corrected.
|
- bugfix: 73_km200: Handling of unknown attributes corrected.
|
||||||
- feature: 31_MilightDevice.pm: Add hue/ct colorpickers.
|
- feature: 31_MilightDevice.pm: Add hue/ct colorpickers.
|
||||||
Add "presets" set command.
|
Add "presets" set command.
|
||||||
- feature: 70_XBMC.pm: new commands poweron,poweroff.
|
- feature: 70_XBMC.pm: new commands poweron,poweroff.
|
||||||
|
@ -14,6 +14,7 @@ at_Initialize($)
|
|||||||
|
|
||||||
$hash->{DefFn} = "at_Define";
|
$hash->{DefFn} = "at_Define";
|
||||||
$hash->{UndefFn} = "at_Undef";
|
$hash->{UndefFn} = "at_Undef";
|
||||||
|
$hash->{SetFn} = "at_Set";
|
||||||
$hash->{AttrFn} = "at_Attr";
|
$hash->{AttrFn} = "at_Attr";
|
||||||
$hash->{StateFn} = "at_State";
|
$hash->{StateFn} = "at_State";
|
||||||
$hash->{AttrList} = "disable:0,1 disabledForIntervals ".
|
$hash->{AttrList} = "disable:0,1 disabledForIntervals ".
|
||||||
@ -24,6 +25,7 @@ at_Initialize($)
|
|||||||
|
|
||||||
my $at_stt_sec;
|
my $at_stt_sec;
|
||||||
my $at_stt_day;
|
my $at_stt_day;
|
||||||
|
my $at_detailFnCalled;
|
||||||
|
|
||||||
sub
|
sub
|
||||||
at_SecondsTillTomorrow($) # 86400, if tomorrow is no DST change
|
at_SecondsTillTomorrow($) # 86400, if tomorrow is no DST change
|
||||||
@ -198,6 +200,29 @@ at_adjustAlign($$)
|
|||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub
|
||||||
|
at_Set($@)
|
||||||
|
{
|
||||||
|
my ($hash, @a) = @_;
|
||||||
|
|
||||||
|
my $cmd = ($at_detailFnCalled ? "modifyTimeSpec" : "modifyTimeSpec:time");
|
||||||
|
$at_detailFnCalled = 0;
|
||||||
|
return "no set argument specified" if(int(@a) < 2);
|
||||||
|
return "Unknown argument $a[1], choose one of $cmd"
|
||||||
|
if($a[1] ne "modifyTimeSpec");
|
||||||
|
|
||||||
|
my ($err, undef) = GetTimeSpec($a[2]);
|
||||||
|
return $err if($err);
|
||||||
|
|
||||||
|
my $def = ($hash->{RELATIVE} eq "yes" ? "+":"").
|
||||||
|
($hash->{PERIODIC} eq "yes" ? "*":"").
|
||||||
|
$a[2];
|
||||||
|
$hash->{OLDDEF} = $hash->{DEF};
|
||||||
|
my $ret = at_Define($hash, "$hash->{NAME} at $def");
|
||||||
|
delete $hash->{OLDDEF};
|
||||||
|
return $ret;
|
||||||
|
}
|
||||||
|
|
||||||
sub
|
sub
|
||||||
at_Attr(@)
|
at_Attr(@)
|
||||||
{
|
{
|
||||||
@ -258,6 +283,8 @@ at_fhemwebFn($$$$)
|
|||||||
my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn.
|
my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn.
|
||||||
my $hash = $defs{$d};
|
my $hash = $defs{$d};
|
||||||
|
|
||||||
|
$at_detailFnCalled = 1 if(!$pageHash);
|
||||||
|
|
||||||
my $ts = $hash->{TIMESPEC}; $ts =~ s/'/\\'/g;
|
my $ts = $hash->{TIMESPEC}; $ts =~ s/'/\\'/g;
|
||||||
my $isPerl = ($ts =~ m/^{(.*)}/);
|
my $isPerl = ($ts =~ m/^{(.*)}/);
|
||||||
$ts = $1 if($isPerl);
|
$ts = $1 if($isPerl);
|
||||||
@ -403,7 +430,18 @@ EOF
|
|||||||
|
|
||||||
|
|
||||||
<a name="atset"></a>
|
<a name="atset"></a>
|
||||||
<b>Set</b> <ul>N/A</ul><br>
|
<b>Set</b>
|
||||||
|
<ul>
|
||||||
|
<a name="modifyTimeSpec"></a>
|
||||||
|
<li>modifyTimeSpec <timespec><br>
|
||||||
|
Change the execution time. Note: the N-times repetition is ignored.
|
||||||
|
It is intended to be used in combination with
|
||||||
|
<a href="#webCmd">webCmd</a>, for an easier modification from the room
|
||||||
|
overview in FHEMWEB.
|
||||||
|
</li>
|
||||||
|
</ul><br>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="atget"></a>
|
<a name="atget"></a>
|
||||||
<b>Get</b> <ul>N/A</ul><br>
|
<b>Get</b> <ul>N/A</ul><br>
|
||||||
@ -546,7 +584,17 @@ EOF
|
|||||||
|
|
||||||
|
|
||||||
<a name="atset"></a>
|
<a name="atset"></a>
|
||||||
<b>Set</b> <ul>N/A</ul><br>
|
<b>Set</b>
|
||||||
|
<ul>
|
||||||
|
<a name="modifyTimeSpec"></a>
|
||||||
|
<li>modifyTimeSpec <timespec><br>
|
||||||
|
Ändert die Ausführungszeit. Achtung: die N-malige
|
||||||
|
Wiederholungseinstellung wird ignoriert. Gedacht zur einfacheren
|
||||||
|
Modifikation im FHEMWEB Raumübersicht, dazu muss man
|
||||||
|
modifyTimeSpec in <a href="webCmd">webCmd</a> spezifizieren.
|
||||||
|
</li>
|
||||||
|
</ul><br>
|
||||||
|
|
||||||
|
|
||||||
<a name="atget"></a>
|
<a name="atget"></a>
|
||||||
<b>Get</b> <ul>N/A</ul><br>
|
<b>Get</b> <ul>N/A</ul><br>
|
||||||
|
@ -806,12 +806,15 @@ FW_createTime(elName, devName, vArr, currVal, set, params, cmd)
|
|||||||
|
|
||||||
var inp = $(newEl).find("[type=text]");
|
var inp = $(newEl).find("[type=text]");
|
||||||
var btn = $(newEl).find("[type=button]");
|
var btn = $(newEl).find("[type=button]");
|
||||||
$(inp).val(currVal ? currVal : "12:00");
|
currVal = (currVal ? currVal : "12:00")
|
||||||
|
.replace(/[^\d]*(\d\d):(\d\d).*/g,"$1:$2");
|
||||||
|
$(inp).val(currVal)
|
||||||
if(elName)
|
if(elName)
|
||||||
$(inp).attr("name", elName);
|
$(inp).attr("name", elName);
|
||||||
|
|
||||||
var hh, mm; // the slider elements
|
var hh, mm; // the slider elements
|
||||||
newEl.setValueFn = function(arg) {
|
newEl.setValueFn = function(arg) {
|
||||||
|
arg = arg.replace(/[^\d]*(\d\d):(\d\d).*/g,"$1:$2");
|
||||||
$(inp).val(arg);
|
$(inp).val(arg);
|
||||||
var hhmm = arg.split(":");
|
var hhmm = arg.split(":");
|
||||||
if(hhmm.length == 2 && hh && mm) {
|
if(hhmm.length == 2 && hh && mm) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user