diff --git a/CHANGED b/CHANGED index 333350623..199962555 100644 --- a/CHANGED +++ b/CHANGED @@ -501,4 +501,5 @@ - bugfix: sunrise stuff fixed, doc missing - feature: CUL FHT sending added - bugfix: workaround to make M232 counter wraparound - - feature: Google Weather API support form FHEM (Boris 2009-06-01) \ No newline at end of file + - feature: Google Weather API support form FHEM (Boris 2009-06-01) + - feature: lazy attribute for FHT devices (Boris 2009-06-09) \ No newline at end of file diff --git a/FHEM/11_FHT.pm b/FHEM/11_FHT.pm index 953edd79e..31ac31696 100755 --- a/FHEM/11_FHT.pm +++ b/FHEM/11_FHT.pm @@ -144,7 +144,7 @@ FHT_Initialize($) $hash->{UndefFn} = "FHT_Undef"; $hash->{ParseFn} = "FHT_Parse"; $hash->{AttrList} = "IODev do_not_notify:0,1 model;fht80b dummy:0,1 " . - "showtime:0,1 loglevel:0,1,2,3,4,5,6 retrycount minfhtbuffer"; + "showtime:0,1 loglevel:0,1,2,3,4,5,6 retrycount minfhtbuffer lazy"; } @@ -175,19 +175,22 @@ FHT_Set($@) my $arg = "020183" . $hash->{CODE}; my ($cmd, $allcmd, $val) = ("", "", ""); + my $lazy= defined($attr{$name}) && + defined($attr{$name}{"lazy"}) && + ($attr{$name}{"lazy"}>0); + my $readings= $hash->{READINGS}; + + while(@a) { $cmd = shift(@a); - $allcmd .=" " if($allcmd); - $allcmd .= $cmd; - return "Unknown argument $cmd, choose one of " . join(" ",sort keys %c2bset) if(!defined($c2b{$cmd})); return "Readonly parameter $cmd" if(defined($cantset{$cmd})); return "\"set $name $cmd\" needs a parameter" if(@a < 1); - $ncmd++; + $val = shift(@a); $arg .= $c2b{$cmd}; @@ -231,12 +234,25 @@ FHT_Set($@) $arg .= sprintf("%02x", $val) if(defined($val)); } - $allcmd .= " $val" if($val); + + + if($lazy && defined($readings->{$cmd}) && $readings->{$cmd}{VAL} eq $val) { + $ret .= "Lazy mode ignores $cmd"; + Log GetLogLevel($name,2), "Lazy mode ignores $cmd $val"; + + } else { + $ncmd++; + $allcmd .=" " if($allcmd); + $allcmd .= $cmd; + $allcmd .= " $val" if($val); + } } return "Too many commands specified, an FHT only supports up to 8" if($ncmd > 8); + return $ret if(!$ncmd); + my $ioname = ""; $ioname = $hash->{IODev}->{NAME} if($hash->{IODev}); if($attr{$ioname} && $attr{$ioname}{fhtsoftbuffer}) { diff --git a/HISTORY b/HISTORY index 2682be50e..ae8b3e2f0 100644 --- a/HISTORY +++ b/HISTORY @@ -407,3 +407,6 @@ - Mon Jun 01 2009 (Boris) - 59_Weather.pm: new virtual device for weather forecasts, documentation updated. + +- Tue Jun 09 2009 (Boris) + - 11_FHT.pm: lazy attribute for FHT devices \ No newline at end of file diff --git a/docs/commandref.html b/docs/commandref.html index 2f860f6d6..4a68fbe06 100644 --- a/docs/commandref.html +++ b/docs/commandref.html @@ -1439,12 +1439,21 @@ A line ending with \ will be concatenated with the next one, so long lines