2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-12 22:56:34 +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:
rudolfkoenig 2015-02-21 19:08:03 +00:00
parent b0c66e58d8
commit 0a77b7d67c
3 changed files with 71 additions and 18 deletions

View File

@ -1,6 +1,8 @@
# 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.
- 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
- feature: help is now a separate module
- feature: pahColor() added to Color.pm to convert temperatures
@ -16,10 +18,10 @@
FWext is automatically deleted after deletion of last
RSS device; RSS Overview and elements opened in new tab;
refresh 0 to disable autorefresh; new function plotFromUrl
- bugfix: SOMFY: use correct attributename when calculating updatetime
- bugfix: SOMFY: use correct attributename when calculating updatetime
- feature: 95_FLOORPLAN.pm: arrange by drag&drop,
copy, rename, delete processes userattr fp_<name>
- added: 30_LIGHTIFY.pm: New module for OSRAM LIGHTIFY gateways
- added: 30_LIGHTIFY.pm: New module for OSRAM LIGHTIFY gateways
- changed: 98_pilight.pm: New protocols
- feature: 55_InfoPanel - added direct link to rect,circle,ellipse,
img, trash
@ -34,7 +36,7 @@
- feature: YAMAHA_AVR: new commands play, pause, stop, skip, shuffle, repeat
- feature: 71_YAMAHA_NP: New command set and readings for menu navigation
- feature: 71_YAMAHA_NP: New command 'dimmer [1..3]'
- bugfix: 31_MilightDevice: if already off don't turn on to set dim level!
- bugfix: 31_MilightDevice: if already off don't turn on to set dim level!
- added: new dustbin icon
- bugfix: SYSMON: some warnings
- changed: SYSMON: documentation
@ -47,8 +49,8 @@
Saturation set/transition, set with command saturation
Bugfix for long transition on hue=0 and hue = 360
Set hardware brightness to minimum before off
- bugfix: FB_CALLMONITOR: allow spaces in phone numbers stored in phonebooks
- bugfix: SYSMON: Symbol '#' in Readings prevents update
- bugfix: FB_CALLMONITOR: allow spaces in phone numbers stored in phonebooks
- bugfix: SYSMON: Symbol '#' in Readings prevents update
- feature: new helper module TimeSeries.pm (Boris)
- feature: 71_YAMAHA_NP.pm: Make timer setting more convenient.
- changed: FB_CALLMONITOR: allow chars in phone numbers for reverse search
@ -60,14 +62,14 @@
tunerAudioModeDAB, tunerFrequencyDAB.
New internals: NP_ICON_x, UDN, Friendly_Name
- changed: 73_km200.pm: More services found.
- bugfix: FB_CALLMONITOR: read phonebooks after all attributes are set
from fhem.cfg.
- bugfix: FB_CALLMONITOR: read phonebooks after all attributes are set
from fhem.cfg.
- feature: 70_XBMC.pm: clear readings when stopping media
- feature: 70_XBMC.pm: new reading is3DFile for 3D files
- bugfix: 70_XBMC.pm: improved JSON separator
- added 73_km200: More services added.
- changed 73_km200: Fhem get-command is able to return raw.
- bugfix 73_km200: Handling of unknown attributes corrected.
- bugfix: 70_XBMC.pm: improved JSON separator
- added: 73_km200: More services added.
- changed: 73_km200: Fhem get-command is able to return raw.
- bugfix: 73_km200: Handling of unknown attributes corrected.
- feature: 31_MilightDevice.pm: Add hue/ct colorpickers.
Add "presets" set command.
- feature: 70_XBMC.pm: new commands poweron,poweroff.

View File

@ -14,6 +14,7 @@ at_Initialize($)
$hash->{DefFn} = "at_Define";
$hash->{UndefFn} = "at_Undef";
$hash->{SetFn} = "at_Set";
$hash->{AttrFn} = "at_Attr";
$hash->{StateFn} = "at_State";
$hash->{AttrList} = "disable:0,1 disabledForIntervals ".
@ -24,6 +25,7 @@ at_Initialize($)
my $at_stt_sec;
my $at_stt_day;
my $at_detailFnCalled;
sub
at_SecondsTillTomorrow($) # 86400, if tomorrow is no DST change
@ -198,6 +200,29 @@ at_adjustAlign($$)
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
at_Attr(@)
{
@ -258,6 +283,8 @@ at_fhemwebFn($$$$)
my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn.
my $hash = $defs{$d};
$at_detailFnCalled = 1 if(!$pageHash);
my $ts = $hash->{TIMESPEC}; $ts =~ s/'/\\'/g;
my $isPerl = ($ts =~ m/^{(.*)}/);
$ts = $1 if($isPerl);
@ -353,9 +380,9 @@ EOF
define a4 at *17:00:00 set lamp on # every day
# relative ones
define a5 at +00:00:10 set lamp on # switch on in 10 seconds
define a6 at +00:00:02 set lamp on-for-timer 1 # Blink once in 2 seconds
define a7 at +*{3}00:00:02 set lamp on-for-timer 1 # Blink 3 times
define a5 at +00:00:10 set lamp on # switch on in 10 seconds
define a6 at +00:00:02 set lamp on-for-timer 1 # Blink once in 2 seconds
define a7 at +*{3}00:00:02 set lamp on-for-timer 1 # Blink 3 times
# Blink 3 times if the piri sends a command
define n1 notify piri:on.* define a8 at +*{3}00:00:02 set lamp on-for-timer 1
@ -403,7 +430,18 @@ EOF
<a name="atset"></a>
<b>Set</b> <ul>N/A</ul><br>
<b>Set</b>
<ul>
<a name="modifyTimeSpec"></a>
<li>modifyTimeSpec &lt;timespec&gt;<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>
<b>Get</b> <ul>N/A</ul><br>
@ -546,7 +584,17 @@ EOF
<a name="atset"></a>
<b>Set</b> <ul>N/A</ul><br>
<b>Set</b>
<ul>
<a name="modifyTimeSpec"></a>
<li>modifyTimeSpec &lt;timespec&gt;<br>
&Auml;ndert die Ausf&uuml;hrungszeit. Achtung: die N-malige
Wiederholungseinstellung wird ignoriert. Gedacht zur einfacheren
Modifikation im FHEMWEB Raum&uuml;bersicht, dazu muss man
modifyTimeSpec in <a href="webCmd">webCmd</a> spezifizieren.
</li>
</ul><br>
<a name="atget"></a>
<b>Get</b> <ul>N/A</ul><br>

View File

@ -806,12 +806,15 @@ FW_createTime(elName, devName, vArr, currVal, set, params, cmd)
var inp = $(newEl).find("[type=text]");
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)
$(inp).attr("name", elName);
var hh, mm; // the slider elements
newEl.setValueFn = function(arg) {
arg = arg.replace(/[^\d]*(\d\d):(\d\d).*/g,"$1:$2");
$(inp).val(arg);
var hhmm = arg.split(":");
if(hhmm.length == 2 && hh && mm) {