From 08b368408e458f6835b555208b281d642ae92986 Mon Sep 17 00:00:00 2001 From: mgehre <> Date: Fri, 7 Dec 2012 22:16:26 +0000 Subject: [PATCH] MAX: implement Undef correctly to fix rereadcfg bug git-svn-id: https://svn.fhem.de/fhem/trunk@2278 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/10_MAX.pm | 9 +++++++++ fhem/FHEM/14_CUL_MAX.pm | 1 + 2 files changed, 10 insertions(+) diff --git a/fhem/FHEM/10_MAX.pm b/fhem/FHEM/10_MAX.pm index 2503396b0..3238fffeb 100755 --- a/fhem/FHEM/10_MAX.pm +++ b/fhem/FHEM/10_MAX.pm @@ -8,6 +8,7 @@ use warnings; use MIME::Base64; sub MAX_Define($$); +sub MAX_Undef($$); sub MAX_Initialize($); sub MAX_Parse($$); sub MAX_Set($@); @@ -42,6 +43,7 @@ MAX_Initialize($) Log 5, "Calling MAX_Initialize"; $hash->{Match} = "^MAX"; $hash->{DefFn} = "MAX_Define"; + $hash->{UndefFn} = "MAX_Undef"; $hash->{ParseFn} = "MAX_Parse"; $hash->{SetFn} = "MAX_Set"; $hash->{AttrList} = "IODev do_not_notify:1,0 ignore:0,1 dummy:0,1 " . @@ -79,6 +81,13 @@ MAX_Define($$) return undef; } +sub +MAX_Undef($$) +{ + my ($hash,$name) = @_; + delete($modules{MAX}{defptr}{$hash->{addr}}); +} + sub MAX_DateTime2Internal($) { diff --git a/fhem/FHEM/14_CUL_MAX.pm b/fhem/FHEM/14_CUL_MAX.pm index a9c3516cc..2779e7bac 100644 --- a/fhem/FHEM/14_CUL_MAX.pm +++ b/fhem/FHEM/14_CUL_MAX.pm @@ -85,6 +85,7 @@ CUL_MAX_Undef($$) { my ($hash, $name) = @_; RemoveInternalTimer($hash); + delete($modules{CUL_MAX}{defptr}); return undef; }