mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-13 03:05:34 +00:00
- feature: lazy attribute for FHT devices (Boris 2009-06-09)
git-svn-id: https://svn.fhem.de/fhem/trunk@387 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
6da188e991
commit
357c0c0f28
@ -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)
|
||||
- feature: Google Weather API support form FHEM (Boris 2009-06-01)
|
||||
- feature: lazy attribute for FHT devices (Boris 2009-06-09)
|
@ -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}) {
|
||||
|
@ -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
|
@ -1439,12 +1439,21 @@ A line ending with \ will be concatenated with the next one, so long lines
|
||||
<a name="minfhtbuffer"></a>
|
||||
<li>minfhtbuffer<br/>
|
||||
Can be applied to FHT devices.<br/>
|
||||
FHEM wont send commands to the FHZ if its fhtbuffer is below
|
||||
FHEM won't send commands to the FHZ if its fhtbuffer is below
|
||||
this value, default is 0. If this value is low, then the ordering of
|
||||
fht commands (see the note in the FHT section of <a href="#set">set</a>)
|
||||
has little effect, as only commands in the softbuffer can be
|
||||
prioritized. The maximum value should be 7 below the hardware maximum
|
||||
(see fhtbuf).
|
||||
</li><br>
|
||||
|
||||
<a name="lazy"></a>
|
||||
<li>lazy<br/>
|
||||
Can be applied to FHT devices.<br/>
|
||||
If the lazy attribute is set, FHEM won't send commands to the FHT if
|
||||
the current reading and the value to be set are already identical. This
|
||||
may help avoiding violations of the max-1%-time-on-air rule in large
|
||||
installations. Not set per default.
|
||||
</li>
|
||||
</ul>
|
||||
<br>
|
||||
|
Loading…
x
Reference in New Issue
Block a user