2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

HMinfo filter ignore, enhance party mode

git-svn-id: https://svn.fhem.de/fhem/trunk@4122 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2013-10-28 12:30:48 +00:00
parent 2674dd3317
commit 7fbf3fec3e
3 changed files with 21 additions and 15 deletions

View File

@ -2183,9 +2183,9 @@ sub CUL_HM_Set($@) {
$days = $a[3];
($eH,$eM) = split(':',$a[2]);
return "use 00 or 30 minutes only" if ($eM !~ m/^(00|30)$/);
return "hour must be between 0 and 23" if ($eH lt 0 || $eH gt 23);
return "days must be between 0 and 200" if ($days < 0 || $days > 200);
return "$eM illegal - use 00 or 30 minutes only" if ($eM !~ m/^(00|30)$/);
return "$eH illegal - hour must be between 0 and 23" if ($eH < 0 || $eH > 23);
return "$days illegal - days must be between 0 and 200" if ($days < 0 || $days > 200);
$eH += 128 if ($eM eq "30");
my $cHash = CUL_HM_id2Hash($dst."02");
$cHash->{helper}{partyReg} = sprintf("61%02X62%02X0000",$eH,$days);
@ -3581,15 +3581,16 @@ sub CUL_HM_SndCmd($$) {
if (!defined $modules{CUL_HM}{$ioName}{tmr}){
# some setup work for this timer
$modules{CUL_HM}{$ioName}{tmr} = 0;
my @arr2 = ();
$modules{CUL_HM}{$ioName}{pendDev} = \@arr2
if (!$modules{CUL_HM}{$ioName}{pendDev});
if (!$modules{CUL_HM}{$ioName}{pendDev}){# generate if not exist
my @arr2 = ();
$modules{CUL_HM}{$ioName}{pendDev} = \@arr2;
}
}
@{$modules{CUL_HM}{$ioName}{pendDev}} =
CUL_HM_noDup(@{$modules{CUL_HM}{$ioName}{pendDev}},$hash->{NAME});
CUL_HM_respPendRm($hash);#rm timer - we are out
if ($modules{CUL_HM}{$ioName}{tmr} != 1){# need to stat timer
if ($modules{CUL_HM}{$ioName}{tmr} != 1){# need to start timer
my $tn = gettimeofday();
InternalTimer($tn+$IOpoll, "CUL_HM_sndIfOpen", "sndIfOpen:$ioName", 0);
$modules{CUL_HM}{$ioName}{tmr} = 1;

View File

@ -180,9 +180,9 @@ sub HMinfo_peerCheck(@) { #####################################################
sub HMinfo_getEntities(@) { ###################################################
my ($filter,$re) = @_;
my @names;
my ($doDev,$doChn,$noVrt,$noPhy,$noAct,$noSen,$doEmp);
my ($doDev,$doChn,$doIgn,$noVrt,$noPhy,$noAct,$noSen,$doEmp);
$doDev=$doChn=$doEmp= 1;
$noVrt=$noPhy=$noAct=$noSen = 0;
$doIgn=$noVrt=$noPhy=$noAct=$noSen = 0;
$filter .= "dc" if ($filter !~ m/d/ && $filter !~ m/c/); # add default
$re = '.' if (!$re);
if ($filter){# options provided
@ -193,6 +193,7 @@ use warnings;
foreach (@pl){
$doDev = 1 if($_ eq 'd');
$doChn = 1 if($_ eq 'c');
$doIgn = 1 if($_ eq 'i');
$noVrt = 1 if($_ eq 'v');
$noPhy = 1 if($_ eq 'p');
$noAct = 1 if($_ eq 'a');
@ -207,15 +208,18 @@ use warnings;
my $eName = $eHash->{NAME};
my $isChn = (length($id) != 6 || CUL_HM_Get($eHash,$eName,"param","channel_01") eq "undefined")?1:0;
my $eMd = CUL_HM_Get($eHash,$eName,"param","model");
my $eIg = CUL_HM_Get($eHash,$eName,"param","ignore");
$eIg = "" if ($eIg eq "undefined");
next if (!(($doDev && length($id) == 6) ||
($doChn && $isChn)));
next if ($noVrt && $eMd =~ m/^virtual/);
next if ($noPhy && $eMd !~ m/^virtual/);
next if (!$doIgn && $eIg);
next if ( $noVrt && $eMd =~ m/^virtual/);
next if ( $noPhy && $eMd !~ m/^virtual/);
my $eSt = CUL_HM_Get($eHash,$eName,"param","subType");
next if ($noSen && $eSt =~ m/^(THSensor|remote|pushButton|threeStateSensor|sensor|motionDetector|swi)$/);
next if ($noAct && $eSt =~ m/^(switch|blindActuator|dimmer|thermostat|smokeDetector|KFM100|outputUnit)$/);
next if ($eName !~ m/$re/);
next if ( $noSen && $eSt =~ m/^(THSensor|remote|pushButton|threeStateSensor|sensor|motionDetector|swi)$/);
next if ( $noAct && $eSt =~ m/^(switch|blindActuator|dimmer|thermostat|smokeDetector|KFM100|outputUnit)$/);
next if ( $eName !~ m/$re/);
push @names,$eName;
}
return sort(@names);
@ -557,6 +561,7 @@ sub HMinfo_SetFn($@) {#########################################################
."\n entities according to list will be processed"
."\n d - device :include devices"
."\n c - channels :include channels"
."\n i - ignore :include devices marked as ignore"
."\n v - virtual :supress fhem virtual"
."\n p - physical :supress physical"
."\n a - aktor :supress actor"

View File

@ -347,7 +347,7 @@ my %culHmRegDefShLg = (# register that are available for short AND long button p
CtRefOff =>{a=> 28.4,s=>0.4,l=>3,min=>0 ,max=>5 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"Jmp on condition from refOff" ,lit=>{geLo=>0,geHi=>1,ltLo=>2,ltHi=>3,between=>4,outside=>5}},
CtrlRc =>{a=> 46 ,s=>0.4,l=>3,min=>0 ,max=>6 ,c=>'lit' ,f=>'' ,u=>'' ,d=>0,t=>"set mode and/or temperature" ,lit=>{no=>0,tempOnly=>1,auto=>2,autoAndTemp=>3,manuAndTemp=>4,boost=>5,toggle=>6}},
TempRC =>{a=> 45 ,s=>0.6,l=>3,min=>5 ,max=>30 ,c=>'' ,f=>2 ,u=>'C' ,d=>0,t=>"temperature reöated to CtrlRc reg"},
TempRC =>{a=> 45 ,s=>0.6,l=>3,min=>5 ,max=>30 ,c=>'' ,f=>2 ,u=>'C' ,d=>0,t=>"temperature repated to CtrlRc reg"},
);
my %culHmRegDefine = (