mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 20:20:10 +00:00
CUL_HM: update alarm time calculation
git-svn-id: https://svn.fhem.de/fhem/trunk@12552 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
6c59336b8c
commit
23bcb8591c
@ -6587,13 +6587,6 @@ sub CUL_HM_SndCmd($$) {
|
|||||||
)
|
)
|
||||||
){
|
){
|
||||||
|
|
||||||
# shall we delay commands if IO device is not present?
|
|
||||||
# it could cause trouble if light switches on after a long period
|
|
||||||
# repetition will be stopped after 1min forsecurity reason.
|
|
||||||
my @arr = ();
|
|
||||||
$hash->{cmdStack} = \@arr if(!$hash->{cmdStack});
|
|
||||||
unshift (@{$hash->{cmdStack}}, $cmd);#pushback cmd, wait for opportunity
|
|
||||||
|
|
||||||
# push device to list
|
# push device to list
|
||||||
if (!defined $modules{CUL_HM}{$ioName}{tmr}){
|
if (!defined $modules{CUL_HM}{$ioName}{tmr}){
|
||||||
# some setup work for this timer
|
# some setup work for this timer
|
||||||
@ -6603,9 +6596,24 @@ sub CUL_HM_SndCmd($$) {
|
|||||||
$modules{CUL_HM}{$ioName}{pendDev} = \@arr2;
|
$modules{CUL_HM}{$ioName}{pendDev} = \@arr2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# shall we delay commands if IO device is not present?
|
||||||
|
# it could cause trouble if light switches on after a long period
|
||||||
|
# repetition will be stopped after 1min forsecurity reason.
|
||||||
|
# so do: return cmd to queue and set state to pending again.
|
||||||
|
# device will be queued @ CUL_HM. Timer will perform cyclic check for IO to return.
|
||||||
|
#
|
||||||
|
my @arr = ();
|
||||||
|
$hash->{cmdStack} = \@arr if(!$hash->{cmdStack});
|
||||||
|
$cmd = $hash->{helper}{prt}{rspWait}{cmd} if( $hash->{helper}{prt}{rspWait}
|
||||||
|
&& $hash->{helper}{prt}{rspWait}{cmd});
|
||||||
|
unshift (@{$hash->{cmdStack}}, $cmd);#pushback cmd, wait for opportunity
|
||||||
|
|
||||||
@{$modules{CUL_HM}{$ioName}{pendDev}} =
|
@{$modules{CUL_HM}{$ioName}{pendDev}} =
|
||||||
CUL_HM_noDup(@{$modules{CUL_HM}{$ioName}{pendDev}},$hash->{NAME});
|
CUL_HM_noDup(@{$modules{CUL_HM}{$ioName}{pendDev}},$hash->{NAME});
|
||||||
CUL_HM_respPendRm($hash);#rm timer - we are out
|
CUL_HM_respPendRm($hash);#rm timer - we are out
|
||||||
|
CUL_HM_protState($hash,"CMDs_pending");
|
||||||
|
|
||||||
if ($modules{CUL_HM}{$ioName}{tmr} != 1){# need to start timer
|
if ($modules{CUL_HM}{$ioName}{tmr} != 1){# need to start timer
|
||||||
my $tn = gettimeofday();
|
my $tn = gettimeofday();
|
||||||
InternalTimer($tn+$IOpoll, "CUL_HM_sndIfOpen", "sndIfOpen:$ioName", 0);
|
InternalTimer($tn+$IOpoll, "CUL_HM_sndIfOpen", "sndIfOpen:$ioName", 0);
|
||||||
@ -7832,6 +7840,18 @@ sub CUL_HM_CvTflt($) { # config time -> float
|
|||||||
my ($inValue) = @_;
|
my ($inValue) = @_;
|
||||||
return ($inValue & 0x1f)*((sort {$a <=> $b} keys(%fltCvT))[$inValue >> 5]);
|
return ($inValue & 0x1f)*((sort {$a <=> $b} keys(%fltCvT))[$inValue >> 5]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub CUL_HM_flt6CvT($) { # float -> config time
|
||||||
|
my ($inValue) = @_;
|
||||||
|
my $exp = ($inValue>127)?1:0;
|
||||||
|
return ($exp << 7)+int($inValue/($exp?60:1));
|
||||||
|
}
|
||||||
|
sub CUL_HM_CvTflt6($) { # config time -> float
|
||||||
|
my ($inValue) = @_;
|
||||||
|
$inValue = 129 if ($inValue == 128);
|
||||||
|
return ($inValue & 0x7f)*(($inValue >> 7)?60:1);
|
||||||
|
}
|
||||||
|
|
||||||
sub CUL_HM_min2time($) { # minutes -> time
|
sub CUL_HM_min2time($) { # minutes -> time
|
||||||
my $min = shift;
|
my $min = shift;
|
||||||
$min = $min * 30;
|
$min = $min * 30;
|
||||||
|
@ -1696,7 +1696,7 @@ sub HMInfo_help(){ ############################################################
|
|||||||
."\n remove a template set"
|
."\n remove a template set"
|
||||||
."\n set templateExe -templateName-"
|
."\n set templateExe -templateName-"
|
||||||
."\n write all assigned templates to the file"
|
."\n write all assigned templates to the file"
|
||||||
."\n get templateUsg -templateName-"
|
."\n get templateUsg -templateName-[sortPeer|sortTemplate]"
|
||||||
."\n show template usage"
|
."\n show template usage"
|
||||||
."\n get templateChk [-typeFilter-] -templateName- -peer:[long|short]- [-param1- ...] "
|
."\n get templateChk [-typeFilter-] -templateName- -peer:[long|short]- [-param1- ...] "
|
||||||
."\n compare whether register match the template values"
|
."\n compare whether register match the template values"
|
||||||
@ -2382,7 +2382,7 @@ sub HMinfo_templateUsg(@){#####################################################
|
|||||||
next if(!defined $defs{$dName}{helper}{tmpl});
|
next if(!defined $defs{$dName}{helper}{tmpl});
|
||||||
foreach my $tid(keys %{$defs{$dName}{helper}{tmpl}}){
|
foreach my $tid(keys %{$defs{$dName}{helper}{tmpl}}){
|
||||||
my ($p,$t) = split(">",$tid);
|
my ($p,$t) = split(">",$tid);
|
||||||
if($tFilter){
|
if($tFilter && $tFilter =~ m/^sort.*/){
|
||||||
if($tFilter eq "sortTemplate"){
|
if($tFilter eq "sortTemplate"){
|
||||||
push @ul,sprintf("%-20s|%-15s|%s|%s",$t,$dName,$p,$defs{$dName}{helper}{tmpl}{$tid});
|
push @ul,sprintf("%-20s|%-15s|%s|%s",$t,$dName,$p,$defs{$dName}{helper}{tmpl}{$tid});
|
||||||
}
|
}
|
||||||
@ -2390,8 +2390,9 @@ sub HMinfo_templateUsg(@){#####################################################
|
|||||||
my ($pn,$ls) = split(":",$p);
|
my ($pn,$ls) = split(":",$p);
|
||||||
push @ul,sprintf("%-20s|%-15s|%5s:%-20s|%s",$pn,$t,$ls,$dName,$defs{$dName}{helper}{tmpl}{$tid});
|
push @ul,sprintf("%-20s|%-15s|%5s:%-20s|%s",$pn,$t,$ls,$dName,$defs{$dName}{helper}{tmpl}{$tid});
|
||||||
}
|
}
|
||||||
elsif($tFilter ne $t){
|
# elsif($tFilter ne $t){
|
||||||
next;}
|
# next;
|
||||||
|
# }
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
my @param;
|
my @param;
|
||||||
@ -2404,8 +2405,9 @@ sub HMinfo_templateUsg(@){#####################################################
|
|||||||
}
|
}
|
||||||
$para = join(" ",@param);
|
$para = join(" ",@param);
|
||||||
}
|
}
|
||||||
|
push @ul,sprintf("%-20s|%-15s|%s|%s",$dName,$p,$t,$para) if(!$tFilter || $tFilter eq $t);
|
||||||
push @ul,sprintf("%-20s|%-15s|%s|%s",$dName,$p,$t,$para);}
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return join("\n",sort(@ul));
|
return join("\n",sort(@ul));
|
||||||
@ -2772,7 +2774,7 @@ sub HMinfo_noDup(@) {#return list with no duplicates###########################
|
|||||||
<li><a name="#HMinfotemplateList">templateList [<name>]</a><br>
|
<li><a name="#HMinfotemplateList">templateList [<name>]</a><br>
|
||||||
list defined templates. If no name is given all templates will be listed<br>
|
list defined templates. If no name is given all templates will be listed<br>
|
||||||
</li>
|
</li>
|
||||||
<li><a name="#HMinfotemplateUsg">templateUsg</a> <template> <br>
|
<li><a name="#HMinfotemplateUsg">templateUsg</a> <template> [sortPeer|sortTemplate]<br>
|
||||||
templare usage<br>
|
templare usage<br>
|
||||||
template filters the output
|
template filters the output
|
||||||
</li>
|
</li>
|
||||||
@ -3220,7 +3222,7 @@ sub HMinfo_noDup(@) {#return list with no duplicates###########################
|
|||||||
<li><a name="#HMinfotemplateList">templateList [<name>]</a><br>
|
<li><a name="#HMinfotemplateList">templateList [<name>]</a><br>
|
||||||
zeigt eine Liste von Vorlagen. Ist kein Name angegeben, werden alle Vorlagen angezeigt<br>
|
zeigt eine Liste von Vorlagen. Ist kein Name angegeben, werden alle Vorlagen angezeigt<br>
|
||||||
</li>
|
</li>
|
||||||
<li><a name="#HMinfotemplateUsg">templateUsg</a> <template> <br>
|
<li><a name="#HMinfotemplateUsg">templateUsg</a> <template> [sortPeer|sortTemplate]<br>
|
||||||
Liste der genutzten templates.<br>
|
Liste der genutzten templates.<br>
|
||||||
template filtert die Einträge nach diesem template
|
template filtert die Einträge nach diesem template
|
||||||
</li>
|
</li>
|
||||||
|
@ -516,7 +516,7 @@ foreach my $al (keys %culHmModel){ # duplicate entries for alias devices
|
|||||||
wakeupDefChan =>{a=> 32.0,s=>1.0,l=>0,min=>0 ,max=>20 ,c=>'' ,f=>'' ,u=>'' ,d=>0,t=>"wakeup default channel"},
|
wakeupDefChan =>{a=> 32.0,s=>1.0,l=>0,min=>0 ,max=>20 ,c=>'' ,f=>'' ,u=>'' ,d=>0,t=>"wakeup default channel"},
|
||||||
wakeupBehavior =>{a=> 33.0,s=>0.1,l=>0,min=>0 ,max=>20 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"wakeup behavior" ,lit=>{off=>0,on=>1}},
|
wakeupBehavior =>{a=> 33.0,s=>0.1,l=>0,min=>0 ,max=>20 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"wakeup behavior" ,lit=>{off=>0,on=>1}},
|
||||||
wakeupBehavMsg =>{a=> 33.1,s=>0.1,l=>0,min=>0 ,max=>20 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"wakeup behavior status message" ,lit=>{off=>0,on=>1}},
|
wakeupBehavMsg =>{a=> 33.1,s=>0.1,l=>0,min=>0 ,max=>20 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"wakeup behavior status message" ,lit=>{off=>0,on=>1}},
|
||||||
alarmTimeMax =>{a=> 34.0,s=>1.0,l=>0,min=>1 ,max=>900 ,c=>'' ,f=>1.6 ,u=>'s' ,d=>0,t=>"maximum Alarm time" ,lit=>{unused=>0}},
|
alarmTimeMax =>{a=> 34.0,s=>1.0,l=>0,min=>1 ,max=>900 ,c=>'fltCvT60' ,f=>'' ,u=>'s' ,d=>0,t=>"maximum Alarm time" ,lit=>{unused=>0}},
|
||||||
|
|
||||||
baudrate =>{a=> 35.0,s=>1.0,l=>0,min=>0 ,max=>6 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"baudrate" ,lit=>{Bd300=>0,Bd600=>1,Bd1200=>2,Bd2400=>3,Bd4800=>4,Bd9600=>5,Bd19200=>6}},
|
baudrate =>{a=> 35.0,s=>1.0,l=>0,min=>0 ,max=>6 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"baudrate" ,lit=>{Bd300=>0,Bd600=>1,Bd1200=>2,Bd2400=>3,Bd4800=>4,Bd9600=>5,Bd19200=>6}},
|
||||||
serialFormat =>{a=> 36.0,s=>1.0,l=>0,min=>0 ,max=>3 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"serial Format" ,lit=>{s7D1PE1S=>0,s7D1PE2S=>1,s8D0PN1S=>2,s8D1PE1S=>3}},
|
serialFormat =>{a=> 36.0,s=>1.0,l=>0,min=>0 ,max=>3 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"serial Format" ,lit=>{s7D1PE1S=>0,s7D1PE2S=>1,s8D0PN1S=>2,s8D1PE1S=>3}},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user