mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-27 20:34:52 +00:00
CUL_HM:correct press for virtuals
git-svn-id: https://svn.fhem.de/fhem/trunk@15887 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
436ef86d60
commit
04f6dc33d6
@ -615,7 +615,7 @@ sub CUL_HM_Rename($$$) {#############################
|
|||||||
my $pPeers = AttrVal($pN, "peerIDs", "");
|
my $pPeers = AttrVal($pN, "peerIDs", "");
|
||||||
if ($pPeers =~ m/$HMidCh/){
|
if ($pPeers =~ m/$HMidCh/){
|
||||||
CUL_HM_ID2PeerList ($pN,"x",0);
|
CUL_HM_ID2PeerList ($pN,"x",0);
|
||||||
foreach my $pR (grep /-$oldName-/,keys%{$pH->{READINGS}}){#update reading of the peer
|
foreach my $pR (grep /(-|\.)$oldName(-|$)/,keys%{$pH->{READINGS}}){#update reading of the peer
|
||||||
my $pRn = $pR;
|
my $pRn = $pR;
|
||||||
$pRn =~ s/$oldName/$name/;
|
$pRn =~ s/$oldName/$name/;
|
||||||
$pH->{READINGS}{$pRn}{VAL} = $pH->{READINGS}{$pR}{VAL};
|
$pH->{READINGS}{$pRn}{VAL} = $pH->{READINGS}{$pR}{VAL};
|
||||||
@ -5659,10 +5659,15 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
|
|||||||
elsif($cmd =~ m/^(press|event)(S|L)/) { ######################################
|
elsif($cmd =~ m/^(press|event)(S|L)/) { ######################################
|
||||||
#press =>"-peer- [-repCount(long only)-] [-repDelay-] ..."
|
#press =>"-peer- [-repCount(long only)-] [-repDelay-] ..."
|
||||||
#event =>"-peer- -cond- [-repCount(long only)-] [-repDelay-] ..."
|
#event =>"-peer- -cond- [-repCount(long only)-] [-repDelay-] ..."
|
||||||
return "no peer defined" if (!defined $a[2]);
|
|
||||||
my ($trig,$type,$peer) = ($1,$2,$a[2]);
|
my ($trig,$type,$peer) = ($1,$2,$a[2]);
|
||||||
my ($cond,$repCnt,$repDly,$mode,$modeCode) = (0,0,0);
|
my ($cond,$repCnt,$repDly,$modeCode,$mode) = (0,0,0);
|
||||||
return "$peer not peered to $name" if (InternalVal($name,"peerList","") !~ m/$peer/);
|
if ($st ne 'virtual'){
|
||||||
|
return "no peer defined" if (!defined $a[2]);
|
||||||
|
return "$peer not peered to $name" if (InternalVal($name,"peerList","") !~ m/$peer/);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
splice @a, 2, 0,"";# shift the array, similate a peer for virtuals
|
||||||
|
}
|
||||||
if ($trig eq "event"){
|
if ($trig eq "event"){
|
||||||
return "condition missing" if (!defined $a[3]);
|
return "condition missing" if (!defined $a[3]);
|
||||||
($cond,$repCnt,$repDly,$modeCode) = ($a[3],$a[4],$a[5],"41");
|
($cond,$repCnt,$repDly,$modeCode) = ($a[3],$a[4],$a[5],"41");
|
||||||
@ -5670,7 +5675,7 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
|
|||||||
$cond = sprintf("%02X",$cond);
|
$cond = sprintf("%02X",$cond);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
($repCnt,$repDly,$modeCode,$cond) = ($a[3],$a[4],"40","");
|
($cond,$repCnt,$repDly,$modeCode) = ("",$a[3],$a[4],"40");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($type eq "L"){
|
if ($type eq "L"){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user