From 792e2c159dced13060f16c2056b57056f5302819 Mon Sep 17 00:00:00 2001 From: hotbso <> Date: Wed, 16 May 2018 12:10:32 +0000 Subject: [PATCH] 98_dewpoint.pm: use NOTIFYDEV with framework functions git-svn-id: https://svn.fhem.de/fhem/trunk@16749 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/98_dewpoint.pm | 28 +--------------------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 428f5bce5..b21315719 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. + - bugfix: 98_dewpoint: Use NOTIFYDEV with framework functions - feature: 57_Calendar: new parameter "limit" (forum #87566) - bugfix: 55_DWD_OpenData: updateAlertsCache causing "not a HASH reference" error on some platforms (forum #83097) diff --git a/fhem/FHEM/98_dewpoint.pm b/fhem/FHEM/98_dewpoint.pm index b6cd91bb1..2fff0d5e8 100644 --- a/fhem/FHEM/98_dewpoint.pm +++ b/fhem/FHEM/98_dewpoint.pm @@ -104,7 +104,7 @@ dewpoint_Define($$) $hash->{DEV_REGEXP} = $devname; # set NOTIFYDEV - $hash->{NOTIFYDEV} = 'global'; + notifyRegexpChanged($hash, $devname); $hash->{STATE} = "active"; return undef; } @@ -119,32 +119,6 @@ dewpoint_Notify($$) my $devName = $dev->{NAME}; my $re = $hash->{DEV_REGEXP}; - # listen to global in order to update our NOTIFYDEV - if ($devName eq 'global') { - # look for INITIALIZED or any device change - my $rebuild; - foreach (@{deviceEvents($dev, 0)}) { - if ($_ =~ m/^(INITIALIZED$)|((DEFINED|MODIFIED|RENAMED|DELETED)\s+)/) { - $rebuild = 1; - last; - } - } - - if ($rebuild) { - # notifyRegexpChanged requires complete device names separated by '|' - # while we allow a true regexp - - # build list of devices matching our RE - my @matched_devs = ('global', grep { m/^$re$/ } keys(%defs)); - - my $notify_re = join('|', @matched_devs); - Log3($hashName, 5, "Update NOTIFYDEV to >>$notify_re<<"); - notifyRegexpChanged($hash, $notify_re); - } - return undef; - } - - # fast exit return "" if (!defined($re) || $devName !~ m/^$re$/);