mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-07 19:04:20 +00:00
CUL_HM:pct level 0 repair
git-svn-id: https://svn.fhem.de/fhem/trunk@15606 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
114101dbd4
commit
da8904d1d1
@ -3842,6 +3842,16 @@ sub CUL_HM_Get($@) {#+++++++++++++++++ get command+++++++++++++++++++++++++++++
|
|||||||
elsif (defined($reg->{lit})){
|
elsif (defined($reg->{lit})){
|
||||||
$help .= " special:".join(",",keys%{$reg->{lit}});
|
$help .= " special:".join(",",keys%{$reg->{lit}});
|
||||||
}
|
}
|
||||||
|
##################
|
||||||
|
# General to be implemented
|
||||||
|
# # ,"0095" => {name=>"HM-CC-RT-DN" ,st=>'thermostat',cyc=>'00:10' ,rxt=>'c:w:f' ,lst=>'p:1p.2p.4p.5p.6p,3:3p.6p,1,7:3p.4'
|
||||||
|
# my $pRq = ((($reg->{l} == 3)||($reg->{l} == 4))
|
||||||
|
# ?"required"
|
||||||
|
# :"");
|
||||||
|
#
|
||||||
|
# my @lCheck = grep /${chn}p/,grep /$reg->{l}:/, split(",",$culHmModel->{$hash->{helper}{mId}}{lst});
|
||||||
|
# $lCheck = @lCheck;
|
||||||
|
##################
|
||||||
push @rI,sprintf("%4d: %-16s | %3s %-14s | %8s | %s\n",
|
push @rI,sprintf("%4d: %-16s | %3s %-14s | %8s | %s\n",
|
||||||
$reg->{l},$regName,$min,$max.$reg->{u},
|
$reg->{l},$regName,$min,$max.$reg->{u},
|
||||||
((($reg->{l} == 3)||($reg->{l} == 4))?"required":""),
|
((($reg->{l} == 3)||($reg->{l} == 4))?"required":""),
|
||||||
@ -4668,12 +4678,11 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
|
|||||||
,"","",0);
|
,"","",0);
|
||||||
my($lvlMin,$lvlMax) = split",",AttrVal($name, "levelRange", "0,100");
|
my($lvlMin,$lvlMax) = split",",AttrVal($name, "levelRange", "0,100");
|
||||||
my $lvlInv = (AttrVal($name, "param", "") =~ m/levelInverse/)?1:0;
|
my $lvlInv = (AttrVal($name, "param", "") =~ m/levelInverse/)?1:0;
|
||||||
|
|
||||||
if ($lvl eq "old"){#keep it - it means "old value"
|
if ($lvl eq "old"){#keep it - it means "old value"
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$lvl =~ s/(\d*\.?\d*).*/$1/;
|
$lvl =~ s/(\d*\.?\d*).*/$1/;
|
||||||
return "level not given" if($lvl == "");
|
return "level not given" if(!defined $lvl);
|
||||||
if ($cmd eq "pct"){
|
if ($cmd eq "pct"){
|
||||||
}
|
}
|
||||||
else{#dim [<changeValue>] ... [ontime] [ramptime]
|
else{#dim [<changeValue>] ... [ontime] [ramptime]
|
||||||
@ -4958,7 +4967,7 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
|
|||||||
CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'80'.$chn.
|
CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'80'.$chn.
|
||||||
sprintf("%02X%02X",$bright,$colVal).$ramp.$tval);
|
sprintf("%02X%02X",$bright,$colVal).$ramp.$tval);
|
||||||
}
|
}
|
||||||
elsif($cmd eq "color") { ################################################
|
elsif($cmd eq "color") { ####################################################
|
||||||
my (undef,undef,$colVal) = @a; #date prepared extention to entdate
|
my (undef,undef,$colVal) = @a; #date prepared extention to entdate
|
||||||
return "cmd requires color[0..100] step 0.5" if (!defined $colVal
|
return "cmd requires color[0..100] step 0.5" if (!defined $colVal
|
||||||
||$colVal < 0 ||$colVal > 100);
|
||$colVal < 0 ||$colVal > 100);
|
||||||
@ -4982,7 +4991,7 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
|
|||||||
CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'81'.$chn.
|
CUL_HM_PushCmdStack($hash,'++'.$flag.'11'.$id.$dst.'81'.$chn.
|
||||||
sprintf("%02X%02X",$bright,$colProg).$min.$max.$ramp.$tval);
|
sprintf("%02X%02X",$bright,$colProg).$min.$max.$ramp.$tval);
|
||||||
}
|
}
|
||||||
elsif($cmd eq "colProgram") { ################################################
|
elsif($cmd eq "colProgram") { ###############################################
|
||||||
my (undef,undef,$colProg) = @a; #date prepared extention to entdate
|
my (undef,undef,$colProg) = @a; #date prepared extention to entdate
|
||||||
return "cmd requires a colorProgram[0..255]" if (!defined $colProg
|
return "cmd requires a colorProgram[0..255]" if (!defined $colProg
|
||||||
||$colProg < 0 ||$colProg > 255);
|
||$colProg < 0 ||$colProg > 255);
|
||||||
@ -8539,9 +8548,9 @@ sub CUL_HM_ActCheck($) {# perform supervision
|
|||||||
|| $tSince gt $tLast){ #no message received in window
|
|| $tSince gt $tLast){ #no message received in window
|
||||||
if ($actHash->{helper}{$devId}{start} lt $tSince){
|
if ($actHash->{helper}{$devId}{start} lt $tSince){
|
||||||
if($autoTry) { #try to send a statusRequest?
|
if($autoTry) { #try to send a statusRequest?
|
||||||
if (!$actHash->{helper}{$devId}{try} || $actHash->{helper}{$devId}{try}<2){
|
if (!$actHash->{helper}{$devId}{try} || $actHash->{helper}{$devId}{try} < 2){
|
||||||
$actHash->{helper}{$devId}{try} = $actHash->{helper}{$devId}{try}
|
$actHash->{helper}{$devId}{try} = $actHash->{helper}{$devId}{try}
|
||||||
? ($actHash->{helper}{$devId}{try} +1)
|
? ($actHash->{helper}{$devId}{try} + 1)
|
||||||
: 1;
|
: 1;
|
||||||
my $cmds = CUL_HM_Set($defs{$devName},$devName,"help");
|
my $cmds = CUL_HM_Set($defs{$devName},$devName,"help");
|
||||||
if ($cmds =~ m/^(statusRequest|getSerial)/){
|
if ($cmds =~ m/^(statusRequest|getSerial)/){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user