fix multiple calls fn _CheckIsDisabledAfterSetAttr by events from other
devices
This commit is contained in:
parent
ec4e32d2fb
commit
cbca8d4337
@ -1,2 +1,2 @@
|
|||||||
UPD 2020-11-03_13:19:18 6242 FHEM/98_backupToStorage.pm
|
UPD 2020-11-03_13:20:01 6242 FHEM/98_backupToStorage.pm
|
||||||
UPD 2020-11-03_13:18:29 18436 lib/FHEM/backupToStorage.pm
|
UPD 2020-11-03_13:44:41 18943 lib/FHEM/backupToStorage.pm
|
||||||
|
@ -204,7 +204,20 @@ sub Notify {
|
|||||||
my $devtype = $dev->{TYPE};
|
my $devtype = $dev->{TYPE};
|
||||||
my $events = deviceEvents( $dev, 1 );
|
my $events = deviceEvents( $dev, 1 );
|
||||||
|
|
||||||
_CheckIsDisabledAfterSetAttr($hash);
|
_CheckIsDisabledAfterSetAttr($hash)
|
||||||
|
if ( (
|
||||||
|
(
|
||||||
|
grep m{^DELETEATTR.$name.(disable|disabledForIntervals)$}xms,
|
||||||
|
@{$events}
|
||||||
|
or grep m{^ATTR.$name.(disable|disabledForIntervals).\S+$}xms,
|
||||||
|
@{$events}
|
||||||
|
)
|
||||||
|
&& $devname eq 'global'
|
||||||
|
&& $init_done
|
||||||
|
)
|
||||||
|
|| $devname eq $name
|
||||||
|
);
|
||||||
|
|
||||||
return if ( !$events
|
return if ( !$events
|
||||||
|| IsDisabled($name) );
|
|| IsDisabled($name) );
|
||||||
|
|
||||||
@ -356,6 +369,8 @@ sub _CheckIsDisabledAfterSetAttr {
|
|||||||
? 'disabled'
|
? 'disabled'
|
||||||
: 'ready' );
|
: 'ready' );
|
||||||
|
|
||||||
|
Log3( $name, 3, "backupToStorage ($name) - _CheckIsDisabledAfterSetAttr" );
|
||||||
|
|
||||||
readingsSingleUpdate($hash, 'state', $state, 1)
|
readingsSingleUpdate($hash, 'state', $state, 1)
|
||||||
if ( ReadingsVal($name, 'state', 'ready' ) ne $state );
|
if ( ReadingsVal($name, 'state', 'ready' ) ne $state );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user