diff --git a/fhem/CHANGED b/fhem/CHANGED index 0a97a0763..22bcfa0ca 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -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 diff --git a/fhem/FHEM/98_dewpoint.pm b/fhem/FHEM/98_dewpoint.pm index 2fff0d5e8..fd9d0ff9c 100644 --- a/fhem/FHEM/98_dewpoint.pm +++ b/fhem/FHEM/98_dewpoint.pm @@ -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>.
Obsolete, avoid for new definitions
  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".
+ If the obsolete behaviour of STATE is mandatory set attribute legacyStateHandling + should be set.

@@ -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.
+ Falls das veraltete Verhalten zum Update unbedingt gewüscht ist, + kann das Attribut legacyStateHandling gesetzt werden.
Beispiele:
@@ -783,7 +788,7 @@ dewpoint_absFeuchte ($$)