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; }