- feature: lazy attribute for FHT devices (Boris 2009-06-09)
git-svn-id: https://fhem.svn.sourceforge.net/svnroot/fhem/trunk/fhem@387 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
3
CHANGED
3
CHANGED
@@ -501,4 +501,5 @@
|
|||||||
- bugfix: sunrise stuff fixed, doc missing
|
- bugfix: sunrise stuff fixed, doc missing
|
||||||
- feature: CUL FHT sending added
|
- feature: CUL FHT sending added
|
||||||
- bugfix: workaround to make M232 counter wraparound
|
- 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->{UndefFn} = "FHT_Undef";
|
||||||
$hash->{ParseFn} = "FHT_Parse";
|
$hash->{ParseFn} = "FHT_Parse";
|
||||||
$hash->{AttrList} = "IODev do_not_notify:0,1 model;fht80b dummy:0,1 " .
|
$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 $arg = "020183" . $hash->{CODE};
|
||||||
my ($cmd, $allcmd, $val) = ("", "", "");
|
my ($cmd, $allcmd, $val) = ("", "", "");
|
||||||
|
|
||||||
|
my $lazy= defined($attr{$name}) &&
|
||||||
|
defined($attr{$name}{"lazy"}) &&
|
||||||
|
($attr{$name}{"lazy"}>0);
|
||||||
|
my $readings= $hash->{READINGS};
|
||||||
|
|
||||||
|
|
||||||
while(@a) {
|
while(@a) {
|
||||||
$cmd = shift(@a);
|
$cmd = shift(@a);
|
||||||
|
|
||||||
$allcmd .=" " if($allcmd);
|
|
||||||
$allcmd .= $cmd;
|
|
||||||
|
|
||||||
return "Unknown argument $cmd, choose one of " . join(" ",sort keys %c2bset)
|
return "Unknown argument $cmd, choose one of " . join(" ",sort keys %c2bset)
|
||||||
if(!defined($c2b{$cmd}));
|
if(!defined($c2b{$cmd}));
|
||||||
return "Readonly parameter $cmd"
|
return "Readonly parameter $cmd"
|
||||||
if(defined($cantset{$cmd}));
|
if(defined($cantset{$cmd}));
|
||||||
return "\"set $name $cmd\" needs a parameter"
|
return "\"set $name $cmd\" needs a parameter"
|
||||||
if(@a < 1);
|
if(@a < 1);
|
||||||
$ncmd++;
|
|
||||||
$val = shift(@a);
|
$val = shift(@a);
|
||||||
$arg .= $c2b{$cmd};
|
$arg .= $c2b{$cmd};
|
||||||
|
|
||||||
@@ -231,12 +234,25 @@ FHT_Set($@)
|
|||||||
$arg .= sprintf("%02x", $val) if(defined($val));
|
$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"
|
return "Too many commands specified, an FHT only supports up to 8"
|
||||||
if($ncmd > 8);
|
if($ncmd > 8);
|
||||||
|
|
||||||
|
return $ret if(!$ncmd);
|
||||||
|
|
||||||
my $ioname = "";
|
my $ioname = "";
|
||||||
$ioname = $hash->{IODev}->{NAME} if($hash->{IODev});
|
$ioname = $hash->{IODev}->{NAME} if($hash->{IODev});
|
||||||
if($attr{$ioname} && $attr{$ioname}{fhtsoftbuffer}) {
|
if($attr{$ioname} && $attr{$ioname}{fhtsoftbuffer}) {
|
||||||
|
|||||||
3
HISTORY
3
HISTORY
@@ -407,3 +407,6 @@
|
|||||||
- Mon Jun 01 2009 (Boris)
|
- Mon Jun 01 2009 (Boris)
|
||||||
- 59_Weather.pm: new virtual device for weather forecasts, documentation
|
- 59_Weather.pm: new virtual device for weather forecasts, documentation
|
||||||
updated.
|
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>
|
<a name="minfhtbuffer"></a>
|
||||||
<li>minfhtbuffer<br/>
|
<li>minfhtbuffer<br/>
|
||||||
Can be applied to FHT devices.<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
|
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>)
|
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
|
has little effect, as only commands in the softbuffer can be
|
||||||
prioritized. The maximum value should be 7 below the hardware maximum
|
prioritized. The maximum value should be 7 below the hardware maximum
|
||||||
(see fhtbuf).
|
(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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
Reference in New Issue
Block a user