mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-02-07 16:59:18 +00:00
CUL_HM:extend dis wm with dynamic text - bugfix1
git-svn-id: https://svn.fhem.de/fhem/trunk@7913 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
bd0f10b438
commit
8e004788d0
@ -262,6 +262,13 @@ sub CUL_HM_updateConfig($){
|
|||||||
elsif ($md =~ m/(HM-CC-VD|ROTO_ZEL-STG-RM-FSA)/){
|
elsif ($md =~ m/(HM-CC-VD|ROTO_ZEL-STG-RM-FSA)/){
|
||||||
$hash->{helper}{oldDes} = "0";
|
$hash->{helper}{oldDes} = "0";
|
||||||
}
|
}
|
||||||
|
elsif ($md =~ m/(HM-Dis-WM55)/){
|
||||||
|
foreach my $t ("s","l"){
|
||||||
|
if(!defined $hash->{helper}{dispi}{$t}{"l1"}{d}){# setup if one is missing
|
||||||
|
$hash->{helper}{dispi}{$t}{"l$_"}{d}=1 foreach (1,2,3,4,5,6);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
elsif ($st eq "dimmer" ) {#setup virtual dimmer channels
|
elsif ($st eq "dimmer" ) {#setup virtual dimmer channels
|
||||||
my $mId = CUL_HM_getMId($hash);
|
my $mId = CUL_HM_getMId($hash);
|
||||||
#configure Dimmer virtual channel assotiation
|
#configure Dimmer virtual channel assotiation
|
||||||
@ -1835,7 +1842,6 @@ sub CUL_HM_Parse($$) {#########################################################
|
|||||||
push @evtEt,[$devH,1,"state:$btnName $state$target"];
|
push @evtEt,[$devH,1,"state:$btnName $state$target"];
|
||||||
if($md eq "HM-Dis-WM55"){
|
if($md eq "HM-Dis-WM55"){
|
||||||
my $type = $trigType eq "Short"?"s":"l";
|
my $type = $trigType eq "Short"?"s":"l";
|
||||||
Log 1,"General got trigger";
|
|
||||||
CUL_HM_calcDisWm($chnHash,$devH->{NAME},($trigType eq "Long"?"l":"s"));
|
CUL_HM_calcDisWm($chnHash,$devH->{NAME},($trigType eq "Long"?"l":"s"));
|
||||||
CUL_HM_PushCmdStack($shash,"++A011$id$src$_")foreach (@{$chnHash->{helper}{disp}{$type}});
|
CUL_HM_PushCmdStack($shash,"++A011$id$src$_")foreach (@{$chnHash->{helper}{disp}{$type}});
|
||||||
}
|
}
|
||||||
@ -4023,13 +4029,16 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
|
|||||||
|
|
||||||
return "$a[2] not valid - choose short or long" if($a[2] !~ m/(short|long)/);
|
return "$a[2] not valid - choose short or long" if($a[2] !~ m/(short|long)/);
|
||||||
my $type = $a[2] eq "short"?"s":"l";
|
my $type = $a[2] eq "short"?"s":"l";
|
||||||
|
|
||||||
|
if(!defined $hash->{helper}{dispi}{$type}{"l1"}{d}){# setup if one is missing
|
||||||
|
$hash->{helper}{dispi}{$type}{"l$_"}{d}=1 foreach (1,2,3,4,5,6);
|
||||||
|
}
|
||||||
|
|
||||||
if($a[3] =~ m/^line(.)$/){
|
if($a[3] =~ m/^line(.)$/){
|
||||||
my $lnNr = $1;
|
my $lnNr = $1;
|
||||||
return "line number wrong - use 1..6" if($lnNr !~ m/[1-6]/);
|
return "line number wrong - use 1..6" if($lnNr !~ m/[1-6]/);
|
||||||
return "please add a text " if(!$a[4]);
|
return "please add a text " if(!$a[4]);
|
||||||
my $lnRd = "disp_$a[2]_l$lnNr";# reading assotiated with this entry
|
my $lnRd = "disp_$a[2]_l$lnNr";# reading assotiated with this entry
|
||||||
$hash->{helper}{dispi}{$type}{"l$_"}{d}=1 foreach (1,2,3,4,5,6);
|
|
||||||
my $dh = $hash->{helper}{dispi}{$type}{"l$lnNr"};
|
my $dh = $hash->{helper}{dispi}{$type}{"l$lnNr"};
|
||||||
if ($a[4] eq "off"){ #no display in this line
|
if ($a[4] eq "off"){ #no display in this line
|
||||||
delete $dh->{txt};
|
delete $dh->{txt};
|
||||||
@ -4071,7 +4080,6 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
|
|||||||
if(($param-1) %3);
|
if(($param-1) %3);
|
||||||
for (my $cnt=3;$cnt<$param;$cnt+=3){
|
for (my $cnt=3;$cnt<$param;$cnt+=3){
|
||||||
my $lnNr = int($cnt/3);
|
my $lnNr = int($cnt/3);
|
||||||
$hash->{helper}{dispi}{$type}{"l$lnNr"}{d}=1;#define this hash
|
|
||||||
my $dh = $hash->{helper}{dispi}{$type}{"l$lnNr"};
|
my $dh = $hash->{helper}{dispi}{$type}{"l$lnNr"};
|
||||||
return "color wrong ".$a[$cnt+1]." use:".join(",",sort keys %disColor) if (!defined $disColor{$a[$cnt+1]});
|
return "color wrong ".$a[$cnt+1]." use:".join(",",sort keys %disColor) if (!defined $disColor{$a[$cnt+1]});
|
||||||
return "icon wrong " .$a[$cnt+2]." use:".join(",",sort keys %disIcon) if (!defined $disIcon {$a[$cnt+2]});
|
return "icon wrong " .$a[$cnt+2]." use:".join(",",sort keys %disIcon) if (!defined $disIcon {$a[$cnt+2]});
|
||||||
@ -5071,7 +5079,7 @@ sub CUL_HM_calcDisWm($$$){
|
|||||||
my ($ch,$ln);
|
my ($ch,$ln);
|
||||||
if($dh->{txt}){
|
if($dh->{txt}){
|
||||||
(undef,$ch,undef,$ln) = unpack('A3A2A1A1',$dh->{txt});
|
(undef,$ch,undef,$ln) = unpack('A3A2A1A1',$dh->{txt});
|
||||||
$ch = sprintf("%02X",$ch);
|
$ch = sprintf("%02X",$ch) if ($ch =~ m/^\d+\d+$/);
|
||||||
my $rd = ($dh->{txt}?"$dh->{txt} ":"- ")
|
my $rd = ($dh->{txt}?"$dh->{txt} ":"- ")
|
||||||
.($dh->{col}?"$dh->{col} ":"- ")
|
.($dh->{col}?"$dh->{col} ":"- ")
|
||||||
.($dh->{icn}?"$dh->{icn} ":"- ")
|
.($dh->{icn}?"$dh->{icn} ":"- ")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user