mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-03 16:56:54 +00:00
CUL_HM: imlement dis-wm55 next step
git-svn-id: https://svn.fhem.de/fhem/trunk@7715 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d7cc9c4532
commit
af40c29c18
@ -3910,6 +3910,7 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
|
|||||||
}
|
}
|
||||||
elsif($cmd eq "displayWM" ) { ###############################################
|
elsif($cmd eq "displayWM" ) { ###############################################
|
||||||
# textNo color icon
|
# textNo color icon
|
||||||
|
# "HM-Dis-WM5501" =>{ displayWM =>"[long|short|help] <lineX> <textNo1> <color1> <icon1> [<textNo2> <color2> <icon2>] ...[<textNo6> <color6> <icon6>] "},
|
||||||
my %color=(white=>0,red=>1,orange=>2,yellow=>3,green=>4,blue=>5);
|
my %color=(white=>0,red=>1,orange=>2,yellow=>3,green=>4,blue=>5);
|
||||||
my %icon=( off =>0, on=>1, open=>2, closed=>3, error=>4, ok=>5
|
my %icon=( off =>0, on=>1, open=>2, closed=>3, error=>4, ok=>5
|
||||||
,info=>6, newMsg=>7, serviceMsg=>8
|
,info=>6, newMsg=>7, serviceMsg=>8
|
||||||
@ -3924,25 +3925,103 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
my $msg = "800102";
|
|
||||||
my $param = (scalar(@a)-2);
|
my $param = (scalar(@a)-2);
|
||||||
return "$a[2] not valid - choose short or long" if($a[2] !~ m/(short|long)/);
|
if ($a[2] eq "help"){
|
||||||
return "not enough parameter - always use txtNo, color and icon in a set"
|
my $ret = "text :";
|
||||||
if(($param-1) %3);
|
foreach (sort keys %btn){
|
||||||
my @txtMsg;
|
my (undef,$ch,undef,$ln) = unpack('A3A2A1A1',$_);
|
||||||
for (my $cnt=3;$cnt<$param;$cnt+=3){
|
$ch = sprintf("%02X",$ch);
|
||||||
return "color wrong ".$a[$cnt+1]." use:".join(",",sort keys %color) if (!defined $color{$a[$cnt+1]});
|
$ret .= "\n $_ ->"
|
||||||
return "icon wrong " .$a[$cnt+2]." use:".join(",",sort keys %icon) if (!defined $icon {$a[$cnt+2]});
|
.ReadingsVal( InternalVal($devName,"channel_$ch","no")
|
||||||
return "text wrong " .$a[$cnt+0]." use:".join(",",sort keys %btn) if (!defined $btn {$a[$cnt+0]});
|
,"text$ln","unkown");
|
||||||
$msg .= sprintf("12%02X11%02X",$btn{$a[$cnt+0]}+0x80,$color{$a[$cnt+1]}+0x80);
|
}
|
||||||
$msg .= sprintf("13%02X",$icon{$a[$cnt+2]}+0x80) if ($icon{$a[$cnt+2]} != 99 );
|
$ret .= "\n off nc(no change)"
|
||||||
$msg .= ($cnt<$param-1)?"0A":"0A03";
|
."\ncolor:".join(",",sort keys %color)
|
||||||
push @txtMsg,$msg;
|
."\n nc(no change)"
|
||||||
$msg = "8001";
|
."\nicon :".join(",",sort keys %icon)
|
||||||
|
;
|
||||||
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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";
|
||||||
delete $hash->{helper}{disp}{$type} if ($hash->{helper}{disp});
|
|
||||||
$hash->{helper}{disp}{$type} = \@txtMsg;
|
if($a[3] =~ m/^line(.)$/){
|
||||||
|
my $lnNr = $1;
|
||||||
|
return "line number wrong - use 1..6" if($lnNr !~ m/[1-6]/);
|
||||||
|
return "please add a text " if(!$a[4]);
|
||||||
|
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"};
|
||||||
|
if ($a[4] eq "off"){ #no display in this line
|
||||||
|
delete $dh->{txt};
|
||||||
|
}
|
||||||
|
else{ # new text
|
||||||
|
return "text wrong $a[4] use:".join(",",sort keys %btn) if (!defined $btn{$a[4]});
|
||||||
|
$dh->{txt}=$a[4];
|
||||||
|
}
|
||||||
|
|
||||||
|
if($a[5]){ # set new color
|
||||||
|
if($a[5] eq "off"){ # set new color
|
||||||
|
delete $dh->{col};
|
||||||
|
}
|
||||||
|
elsif($a[5] ne "nc"){ # set new color
|
||||||
|
return "color wrong $a[5] use:".join(",",sort keys %color) if (!defined $color{$a[5]});
|
||||||
|
$dh->{col}=$a[5];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($a[6]){ # new icon
|
||||||
|
if($a[6] eq "noIcon"){ # new icon
|
||||||
|
delete $dh->{icn};
|
||||||
|
}
|
||||||
|
elsif($a[6] ne "nc"){ # new icon
|
||||||
|
return "icon wrong $a[6] use:".join(",",sort keys %icon) if (!defined $icon {$a[6]});
|
||||||
|
$dh->{icn}=$a[6];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return "not enough parameter - always use txtNo, color and icon in a set"
|
||||||
|
if(($param-1) %3);
|
||||||
|
for (my $cnt=3;$cnt<$param;$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"};
|
||||||
|
return "color wrong ".$a[$cnt+1]." use:".join(",",sort keys %color) if (!defined $color{$a[$cnt+1]});
|
||||||
|
return "icon wrong " .$a[$cnt+2]." use:".join(",",sort keys %icon) if (!defined $icon {$a[$cnt+2]});
|
||||||
|
return "text wrong " .$a[$cnt+0]." use:".join(",",sort keys %btn) if (!defined $btn {$a[$cnt+0]});
|
||||||
|
$dh->{txt} = $a[$cnt+0];
|
||||||
|
$dh->{col} = $a[$cnt+1];
|
||||||
|
$dh->{icn} = $a[$cnt+2];
|
||||||
|
delete $dh->{icn} if ($a[$cnt+2] ne "noIcon");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach my $t (keys %{$hash->{helper}{dispi}}){ # prepare the messages
|
||||||
|
my $ts = $t eq "s"?"short":"long";
|
||||||
|
my @txtMsg;
|
||||||
|
my $msg = "800102";
|
||||||
|
foreach my $l (sort keys %{$hash->{helper}{dispi}{$t}}){
|
||||||
|
my $dh = $hash->{helper}{dispi}{$t}{"$l"};
|
||||||
|
my (undef,$ch,undef,$ln) = unpack('A3A2A1A1',$dh->{txt});
|
||||||
|
$ch = sprintf("%02X",$ch);
|
||||||
|
|
||||||
|
readingsSingleUpdate($hash,"disp_${ts}_$l",
|
||||||
|
"$dh->{txt} $dh->{col} $dh->{icn} ->"
|
||||||
|
.ReadingsVal(InternalVal($devName,"channel_$ch","no")
|
||||||
|
,"text$ln","unkown")
|
||||||
|
,0);
|
||||||
|
$msg .= sprintf("12%02X",$btn{$dh->{txt} }+0x80)if ($dh->{txt});
|
||||||
|
$msg .= sprintf("11%02X",$color{$dh->{col}}+0x80)if ($dh->{col});
|
||||||
|
$msg .= sprintf("13%02X",$icon{$dh->{icn} }+0x80)if ($dh->{icn});
|
||||||
|
$msg .= "0A";# end of line indicator
|
||||||
|
push @txtMsg,$msg;
|
||||||
|
$msg = "8001";
|
||||||
|
}
|
||||||
|
$txtMsg[scalar(@txtMsg)-1] .= "03" if(scalar(@txtMsg));# add end of message indicator
|
||||||
|
delete $hash->{helper}{disp}{$t} if ($hash->{helper}{disp});
|
||||||
|
$hash->{helper}{disp}{$t} = \@txtMsg;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
elsif($cmd =~ m/^(controlMode|controlManu|controlParty)$/) { ################
|
elsif($cmd =~ m/^(controlMode|controlManu|controlParty)$/) { ################
|
||||||
@ -8174,13 +8253,24 @@ sub CUL_HM_tempListTmpl(@) { ##################################################
|
|||||||
</li>
|
</li>
|
||||||
<li>HM-Dis-WM55
|
<li>HM-Dis-WM55
|
||||||
<ul>
|
<ul>
|
||||||
<li><B>displayWM <text1> <color1> <icon1> ... <text6> <color6> <icon6>
|
<li><B>displayWM help </B>
|
||||||
</B><br>
|
<B>displayWM [long|short] <text1> <color1> <icon1> ... <text6> <color6> <icon6></B>
|
||||||
|
<B>displayWM [long|short] <lineX> <text> <color> <icon></B>
|
||||||
|
<br>
|
||||||
up to 6 lines can be addressed.<br>
|
up to 6 lines can be addressed.<br>
|
||||||
<B>textNo</B> is the text to be dispalyed in line No. The text is asotiated with the text defined for the buttons.
|
<B>lineX</B> line number that shall be changed. If this is set the 3 parameter of a line can be adapted. <br>
|
||||||
txt<BtnNo>_<lineNo> references the button 1 to 10 and their lines 1 or 2<br>
|
<B>textNo</B> is the text to be dispalyed in line No. The text is assotiated with the text defined for the buttons.
|
||||||
<B>color</B> is one white,red, orange,yellow,green,blue<br>
|
txt<BtnNo>_<lineNo> references channel 1 to 10 and their lines 1 or 2<br>
|
||||||
<B>icon</B> is one off,on,open,closed,error,ok,noIcon<br>
|
<B>color</B> is one white, red, orange, yellow, green, blue<br>
|
||||||
|
<B>icon</B> is one off, on, open, closed, error, ok, noIcon<br>
|
||||||
|
Example:
|
||||||
|
<ul><code>
|
||||||
|
set disp01 displayWM short txt02_2 green noIcon txt10_1 red error txt05_2 yellow closed txt02_2 orange open <br>
|
||||||
|
set disp01 displayWM long line3 txt02_2 green noIcon<br>
|
||||||
|
set disp01 displayWM long line2 nc yellow noIcon<br>
|
||||||
|
set disp01 displayWM long line6 txt02_2<br>
|
||||||
|
set disp01 displayWM long line1 nc nc closed<br>
|
||||||
|
</ul></code>
|
||||||
</li>
|
</li>
|
||||||
</ul><br>
|
</ul><br>
|
||||||
</li>
|
</li>
|
||||||
@ -9436,14 +9526,26 @@ sub CUL_HM_tempListTmpl(@) { ##################################################
|
|||||||
</li>
|
</li>
|
||||||
<li>HM-Dis-WM55
|
<li>HM-Dis-WM55
|
||||||
<ul>
|
<ul>
|
||||||
<li><B>displayWM <text1> <color1> <icon1> ... <text6> <color6> <icon6>
|
<li><B>displayWM help </B>
|
||||||
</B><br>
|
<B>displayWM [long|short] <text1> <color1> <icon1> ... <text6> <color6> <icon6></B>
|
||||||
bis zu 6 Zeilen können addresiert werden. <br>
|
<B>displayWM [long|short] <lineX> <text> <color> <icon></B>
|
||||||
<B>textNo</B> ist der anzuzeigende Text. Der Inhalt des Texts wird in den Buttonds definiert.
|
<br>
|
||||||
txt<BtnNo>_<lineNo> referenziert den Button und dessn jeweiligen Zeile<br>
|
es können bis zu 6 Zeilen programmiert werden.<br>
|
||||||
<B>color</B> kann sein white,red, orange,yellow,green,blue<br>
|
<B>lineX</B> legt die zu ändernde Zeilennummer fest. Es können die 3 Parameter der Zeile geändert werden.<br>
|
||||||
<B>icon</B> kann sein off,on,open,closed,error,ok,noIcon<br>
|
<B>textNo</B> ist der anzuzeigende Text. Der Inhalt des Texts wird in den Buttonds definiert.
|
||||||
</li>
|
txt<BtnNo>_<lineNo> referenziert den Button und dessn jeweiligen Zeile<br>
|
||||||
|
<B>color</B> kann sein white, red, orange, yellow, green, blue<br>
|
||||||
|
<B>icon</B> kann sein off, on, open, closed, error, ok, noIcon<br>
|
||||||
|
|
||||||
|
Example:
|
||||||
|
<ul><code>
|
||||||
|
set disp01 displayWM short txt02_2 green noIcon txt10_1 red error txt05_2 yellow closed txt02_2 orange open <br>
|
||||||
|
set disp01 displayWM long line3 txt02_2 green noIcon<br>
|
||||||
|
set disp01 displayWM long line2 nc yellow noIcon<br>
|
||||||
|
set disp01 displayWM long line6 txt02_2<br>
|
||||||
|
set disp01 displayWM long line1 nc nc closed<br>
|
||||||
|
</ul></code>
|
||||||
|
</li>
|
||||||
</ul><br>
|
</ul><br>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
@ -1573,7 +1573,7 @@ $culHmModelSets{"HM-Dis-WM55"} = $culHmModelSets{"HM-PB-4DIS-WM"};
|
|||||||
,statusRequest =>""},
|
,statusRequest =>""},
|
||||||
"HM-CC-RT-DN06" =>{ press =>"[long|short] [<peer>] [<repCount(long only)>] [<repDelay>] ..."
|
"HM-CC-RT-DN06" =>{ press =>"[long|short] [<peer>] [<repCount(long only)>] [<repDelay>] ..."
|
||||||
},
|
},
|
||||||
"HM-Dis-WM5501" =>{ displayWM =>"[long|short] <textNo1> <color1> <icon1> [<textNo2> <color2> <icon2>] ...[<textNo6> <color6> <icon6>] "},
|
"HM-Dis-WM5501" =>{ displayWM =>"[long|short|help] <lineX> <textNo1> <color1> <icon1> [<textNo2> <color2> <icon2>] ...[<textNo6> <color6> <icon6>] "},
|
||||||
"CCU-FHEM00" =>{ update =>"",
|
"CCU-FHEM00" =>{ update =>"",
|
||||||
hmPairForSec =>"<sec>",
|
hmPairForSec =>"<sec>",
|
||||||
hmPairSerial =>"<serial>",
|
hmPairSerial =>"<serial>",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user