2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

listEevnts for command, improve condBurst

git-svn-id: https://svn.fhem.de/fhem/trunk@3950 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2013-09-23 18:03:20 +00:00
parent 03f0292e76
commit 85e6a0fea0
2 changed files with 46 additions and 31 deletions

View File

@ -2096,28 +2096,44 @@ sub CUL_HM_Set($@) {
splice @a, 1, 0,"pct";#insert the actual command splice @a, 1, 0,"pct";#insert the actual command
} }
elsif(!defined($h)) { elsif(!defined($h)) {
my @arr; my @arr1 = ();
@arr = keys %culHmGlobalSets if( $st ne "virtual");
push @arr, keys %culHmGlobalSetsVrtDev if(($st eq "virtual"||!$st) && $roleD); if( $st ne "virtual") {foreach(keys %culHmGlobalSets ){push @arr1,"$_:$culHmGlobalSets{$_}" }};
push @arr, keys %culHmGlobalSetsDevice if( $st ne "virtual" && $roleD); if(($st eq "virtual"||!$st) && $roleD){foreach(keys %culHmGlobalSetsVrtDev ){push @arr1,"$_:$culHmGlobalSetsVrtDev{$_}" }};
push @arr, keys %{$culHmSubTypeDevSets{$st}} if( $st ne "virtual" && $roleD); if( $st ne "virtual" && $roleD){foreach(keys %culHmGlobalSetsDevice ){push @arr1,"$_:$culHmGlobalSetsDevice{$_}" }};
push @arr, keys %culHmGlobalSetsChn if( $st ne "virtual" && $roleC); if( $st ne "virtual" && $roleD){foreach(keys %{$culHmSubTypeDevSets{$st}}){push @arr1,"$_:${$culHmSubTypeDevSets{$st}}{$_}"}};
push @arr, keys %{$culHmSubTypeSets{$st}} if( $culHmSubTypeSets{$st} && $roleC); if( $st ne "virtual" && $roleC){foreach(keys %culHmGlobalSetsChn ){push @arr1,"$_:$culHmGlobalSetsChn{$_}" }};
push @arr, keys %{$culHmModelSets{$md}} if( $culHmModelSets{$md}); if( $culHmSubTypeSets{$st} && $roleC){foreach(keys %{$culHmSubTypeSets{$st}} ){push @arr1,"$_:${$culHmSubTypeSets{$st}}{$_}" }};
push @arr, keys %{$culHmChanSets{$md."00"}} if( $culHmChanSets{$md."00"} && $roleD); if( $culHmModelSets{$md}) {foreach(keys %{$culHmModelSets{$md}} ){push @arr1,"$_:${$culHmModelSets{$md}}{$_}" }};
push @arr, keys %{$culHmChanSets{$md.$chn}} if( $culHmChanSets{$md.$chn} && $roleC); if( $culHmChanSets{$md."00"} && $roleD){foreach(keys %{$culHmChanSets{$md."00"}} ){push @arr1,"$_:".${$culHmChanSets{$md."00"}}{$_}}};
@arr = CUL_HM_noDup(@arr); if( $culHmChanSets{$md.$chn} && $roleC){foreach(keys %{$culHmChanSets{$md.$chn}} ){push @arr1,"$_:".${$culHmChanSets{$md.$chn}}{$_}}};
my $usg = "Unknown argument $cmd, choose one of ".join(" ",sort @arr); @arr1 = CUL_HM_noDup(@arr1);
foreach(@arr1){
my ($cmd,$val) = split(":",$_,2);
if (!$val ||
$val !~ m/^\[.*\]$/ ||
$val =~ m/\[.*\[/ ||
$val =~ m/(\<|\>)]/
){
$_ = $cmd;
}
else{
$val =~ s/(\[|\])//g;
my @vArr = split('\|',$val);
foreach (@vArr){
if ($_ =~ m/(.*)\.\.(.*)/ ){
my @list = map { ($_.".0", $_+0.5) } ($1..$2);
pop @list;
$_ = join(",",@list);
}
}
$_ = "$cmd:".join(",",@vArr);
}
}
my $usg = "Unknown argument $cmd, choose one of ".join(" ",sort @arr1);
$usg =~ s/ pct/ pct:slider,0,1,100/; $usg =~ s/ pct/ pct:slider,0,1,100/;
$usg =~ s/ virtual/ virtual:slider,1,1,40/; $usg =~ s/ virtual/ virtual:slider,1,1,40/;
if($md eq "HM-CC-TC") {
my @list = map { ($_.".0", $_+0.5) } (6..30);
pop @list;
my $list = "on,off," . join(",",@list);
$usg =~ s/-temp/-temp:$list/g;
}
return $usg; return $usg;
} }
elsif($h eq "" && @a != 2) { elsif($h eq "" && @a != 2) {
@ -3393,7 +3409,7 @@ sub CUL_HM_responseSetup($$) {#store all we need to handle the response
elsif($mTp eq '11' && $chn =~ m/^(02|81)$/){#!!! chn is subtype!!! elsif($mTp eq '11' && $chn =~ m/^(02|81)$/){#!!! chn is subtype!!!
CUL_HM_qStateUpdatIfEnab($dst); CUL_HM_qStateUpdatIfEnab($dst);
} }
elsif($mTp eq '12'){#wakeup elsif($mTp eq '12' && $mFlg & 0x10){#wakeup with burst
# response setup - do not repeat, set counter to 250 # response setup - do not repeat, set counter to 250
CUL_HM_respWaitSu ($hash,"cmd:$cmd","mNo:$mNo","reSent:250","wakeup:1"); CUL_HM_respWaitSu ($hash,"cmd:$cmd","mNo:$mNo","reSent:250","wakeup:1");
return; return;
@ -3404,7 +3420,6 @@ sub CUL_HM_responseSetup($$) {#store all we need to handle the response
} }
CUL_HM_respWaitSu ($hash,"cmd:$cmd","mNo:$mNo","reSent:1"); CUL_HM_respWaitSu ($hash,"cmd:$cmd","mNo:$mNo","reSent:1");
CUL_HM_protState($hash,"CMDs_processing..."); CUL_HM_protState($hash,"CMDs_processing...");
} }
else{# no answer expected else{# no answer expected

View File

@ -978,7 +978,7 @@ my %culHmModelSets = (# channels of this subtype-------------
"HM-CC-VD" =>{ valvePos => "position"}, "HM-CC-VD" =>{ valvePos => "position"},
"HM-RC-19" =>{ service => "<count>" "HM-RC-19" =>{ service => "<count>"
,alarm => "<count>" ,alarm => "<count>"
,display => "<text> [comma,no] [unit] [off|1|2|3] [off|on|slow|fast] <symbol>"}, ,display => "<text> [comma|no] [unit] [off|1|2|3] [off|on|slow|fast] <symbol>"},
"HM-PB-4DIS-WM"=>{ text => "<txt1> <txt2>..." "HM-PB-4DIS-WM"=>{ text => "<txt1> <txt2>..."
#text => "<btn> [on|off] <txt1> <txt2>...", old style will not be offered anymore #text => "<btn> [on|off] <txt1> <txt2>...", old style will not be offered anymore
}, },
@ -995,16 +995,16 @@ $culHmModelSets{"HM-RC-19-SW"} = $culHmModelSets{"HM-RC-19"};
#%{$culHmModelSets{"HM-RC-19-SW"}} = %{$culHmModelSets{"HM-RC-19"}}; copy #%{$culHmModelSets{"HM-RC-19-SW"}} = %{$culHmModelSets{"HM-RC-19"}}; copy
my %culHmChanSets = ( my %culHmChanSets = (
"HM-CC-TC00" =>{ "day-temp" =>"[on,off,6.0..30.0]", "HM-CC-TC00" =>{ "day-temp" =>"[on|off|6.0..30.0]",
"night-temp" =>"[on,off,6.0..30.0]", "night-temp" =>"[on|off|6.0..30.0]",
"party-temp" =>"[on,off,6.0..30.0]", "party-temp" =>"[on|off|6.0..30.0]",
"desired-temp" =>"[on,off,6.0..30.0]", "desired-temp" =>"[on|off|6.0..30.0]",
sysTime =>"" }, sysTime =>"" },
"HM-CC-TC02" =>{ peerChan =>" 0 <actChn> ... single [set|unset] [actor|remote|both]" "HM-CC-TC02" =>{ peerChan =>" 0 <actChn> ... single [set|unset] [actor|remote|both]"
,"day-temp" =>"[on,off,6.0..30.0]" ,"day-temp" =>"[on|off|6.0..30.0]"
,"night-temp" =>"[on,off,6.0..30.0]" ,"night-temp" =>"[on|off|6.0..30.0]"
,"party-temp" =>"[on,off,6.0..30.0]" ,"party-temp" =>"[on|off|6.0..30.0]"
,"desired-temp" =>"[on,off,6.0..30.0]" ,"desired-temp" =>"[on|off|6.0..30.0]"
,tempListSat =>"HH:MM temp ..." ,tempListSat =>"HH:MM temp ..."
,tempListSun =>"HH:MM temp ..." ,tempListSun =>"HH:MM temp ..."
,tempListMon =>"HH:MM temp ..." ,tempListMon =>"HH:MM temp ..."
@ -1039,7 +1039,7 @@ my %culHmChanSets = (
,tempListThu =>"HH:MM temp ..." ,tempListThu =>"HH:MM temp ..."
,tempListWed =>"HH:MM temp ..." ,tempListWed =>"HH:MM temp ..."
,tempListFri =>"HH:MM temp ..." ,tempListFri =>"HH:MM temp ..."
,"desired-temp" =>"[on,off,6.0..30.0]" ,"desired-temp" =>"[on|off|5.0..30.0]"
}, },
"HM-CC-RT-DN05" =>{ peerChan =>" 0 <actChn> ... [single] [set|unset] [actor|remote|both]"}, "HM-CC-RT-DN05" =>{ peerChan =>" 0 <actChn> ... [single] [set|unset] [actor|remote|both]"},
); );