diff --git a/fhem/CHANGED b/fhem/CHANGED index 7fe58def6..c880b5ccd 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -463,3 +463,4 @@ - feature: contrib/fhem2speech from Martin - bugfix: attributes of at devices disappear - feature: attribute rainadjustment for KS300 (Boris 2008-12-17) + - bugfix: deleting at / watchdog while active creates an empty device diff --git a/fhem/FHEM/90_at.pm b/fhem/FHEM/90_at.pm index e2cebd111..c36f330a0 100755 --- a/fhem/FHEM/90_at.pm +++ b/fhem/FHEM/90_at.pm @@ -12,6 +12,7 @@ at_Initialize($) my ($hash) = @_; $hash->{DefFn} = "at_Define"; + $hash->{UndefFn} = "at_Undef"; $hash->{AttrFn} = "at_Attr"; $hash->{AttrList} = "disable:0,1 skip_next:0,1"; } @@ -75,6 +76,14 @@ at_Define($$) return undef; } +sub +at_Undef($$) +{ + my ($hash, $name) = @_; + RemoveInternalTimer($name); + return undef; +} + sub at_Exec($) { diff --git a/fhem/FHEM/91_watchdog.pm b/fhem/FHEM/91_watchdog.pm index 2c3dab903..4af6753f4 100755 --- a/fhem/FHEM/91_watchdog.pm +++ b/fhem/FHEM/91_watchdog.pm @@ -12,6 +12,7 @@ watchdog_Initialize($) my ($hash) = @_; $hash->{DefFn} = "watchdog_Define"; + $hash->{UndefFn} = "watchdog_Undef"; $hash->{NotifyFn} = "watchdog_Notify"; $hash->{AttrList} = "disable:0,1"; } @@ -108,5 +109,13 @@ watchdog_Activate($) InternalTimer($nt, "watchdog_Trigger", $ntfy, 0) } +sub +watchdog_Undef($$) +{ + my ($hash, $name) = @_; + RemoveInternalTimer($hash); + return undef; +} + 1;