98_dewpoint.pm: new attribute legacyStateHandling
git-svn-id: https://svn.fhem.de/fhem/trunk@16824 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- change: 98_dewpoint: new attribute legacyStateHandling
|
||||
- feature: 93_DbRep: V7.18.0, possible use of y:(\d) in timeDiffToNow,
|
||||
timeOlderThan, delEntries considers executeBeforeDump,
|
||||
executeAfterDump, minor fixes
|
||||
|
||||
@@ -40,7 +40,7 @@ dewpoint_Initialize($)
|
||||
$hash->{DefFn} = "dewpoint_Define";
|
||||
$hash->{NotifyFn} = "dewpoint_Notify";
|
||||
$hash->{NotifyOrderPrefix} = "10-"; # Want to be called before the rest
|
||||
$hash->{AttrList} = "disable:0,1 verbose max_timediff absFeuchte";
|
||||
$hash->{AttrList} = "disable:0,1 legacyStateHandling:0,1 verbose max_timediff absFeuchte";
|
||||
}
|
||||
|
||||
|
||||
@@ -287,7 +287,8 @@ dewpoint_Notify($$)
|
||||
$sensor = $new_name;
|
||||
|
||||
my $has_state_format = defined(AttrVal($dev->{NAME}, "stateFormat", undef));
|
||||
if ($temp_name ne "T" || $has_state_format) {
|
||||
my $legacy_sh = AttrVal($hash->{NAME}, "legacyStateHandling", 0);
|
||||
if ($temp_name ne "T" || ($has_state_format && ! $legacy_sh)) {
|
||||
$current = $dewpoint;
|
||||
readingsBulkUpdate($dev, $sensor, $current);
|
||||
readingsEndUpdate($dev, 1);
|
||||
@@ -525,7 +526,9 @@ dewpoint_absFeuchte ($$)
|
||||
and write the calculated dewpoint to reading <new_name>.<br>
|
||||
<b>Obsolete, avoid for new definitions</b><br>
|
||||
If <temp_name> is T then use temperature from state T: H:, add <new_name> to the STATE.
|
||||
The addition to STATE only occurs if the target device does not define attribute "stateFormat".
|
||||
The addition to STATE only occurs if the target device does not define attribute "stateFormat".<br>
|
||||
If the obsolete behaviour of STATE is mandatory set attribute <code>legacyStateHandling</code>
|
||||
should be set.
|
||||
</ul>
|
||||
<br><br>
|
||||
|
||||
@@ -683,6 +686,8 @@ dewpoint_absFeuchte ($$)
|
||||
Wenn <temp_name> T lautet, wird die Temperatur aus state T: H: benutzt
|
||||
und <new_name> zu STATE hinzugefügt. Das hinzufügen zu STATE erfolgt nur, falls im Zielgerät
|
||||
das Attribut "stateFormat" nicht definiert ist.<br>
|
||||
Falls das veraltete Verhalten zum Update unbedingt gewüscht ist,
|
||||
kann das Attribut <code>legacyStateHandling</code> gesetzt werden.
|
||||
<br/>
|
||||
Beispiele:
|
||||
<pre>
|
||||
@@ -783,7 +788,7 @@ dewpoint_absFeuchte ($$)
|
||||
<ul>
|
||||
Durch setzen des Attributes absFeuchte wird in den Readings auch die absolute Feuchte mit ausgerechnet.
|
||||
Durch <a href="#stateFormat">stateFormat</a> kann man diese Info auch im Status anzeigen.
|
||||
Beispiel: (<Adapter> = Der FHEM Name des Adapters der ge<EFBFBD>ndert werden muss)
|
||||
Beispiel: (<Adapter> = Der FHEM Name des Adapters der geändert werden muss)
|
||||
<pre>
|
||||
stateFormat:
|
||||
{sprintf("T: %.1f H: %.1f D: %.1f A: %.1f", ReadingsVal("<Adapter>","temperature",0), ReadingsVal("<Adapter>","H",0), ReadingsVal("<Adapter>","dewpoint",0), ReadingsVal("<Adapter>","absFeuchte",0))}
|
||||
|
||||
Reference in New Issue
Block a user