2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 04:36:36 +00:00

98_MSwitch.pm: Bugfix

git-svn-id: https://svn.fhem.de/fhem/trunk@20107 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Byte09 2019-09-05 04:06:13 +00:00
parent 80802f2043
commit 95fb4c3144

View File

@ -2577,33 +2577,27 @@ sub MSwitch_Attr(@) {
if ( $cmd eq 'set' && $aName eq 'disable' && $aVal == 0 ) {
delete( $hash->{helper}{savemodeblock} );
delete( $hash->{READINGS}{Safemode} );
my $notedef = ReadingsVal( $name, 'Trigger_device', 'no_trigger' );
if ($notedef eq "MSwitch_Self" ) {$notedef = $name}
$hash->{NOTIFYDEV} = $notedef;
MSwitch_Createtimer($hash);
}
# if ( $cmd eq 'set'
# && $aName eq 'disable'
# && $aVal == 0
# && ReadingsVal( $name, 'Trigger_device', 'no_trigger' ) ne
# 'no_trigger' )
# {
# $hash->{NOTIFYDEV} =
# ReadingsVal( $name, 'Trigger_device', 'no_trigger' );
# }
if ( $cmd eq 'set'
&& $aName eq 'disable'
&& $aVal == 0
&& ReadingsVal( $name, 'Trigger_device', 'no_trigger' ) ne
'no_trigger' )
{
$hash->{NOTIFYDEV} =
ReadingsVal( $name, 'Trigger_device', 'no_trigger' );
}
# if ( $cmd eq 'del' && $aName eq 'disable' && ReadingsVal( $name, 'Trigger_device', 'no_trigger' ) ne
# 'no_trigger' )
# {
# my $notedef = ReadingsVal( $name, 'Trigger_device', 'no_trigger' );
# if ($notedef eq "MSwitch_Self" ) {$notedef = $name}
# $hash->{NOTIFYDEV} = $notedef;
# }
if ( $cmd eq 'del'
&& $aName eq 'disable'
&& ReadingsVal( $name, 'Trigger_device', 'no_trigger' ) ne
'no_trigger' )
{
$hash->{NOTIFYDEV} =
ReadingsVal( $name, 'Trigger_device', 'no_trigger' );
}
if ( $aName eq 'MSwitch_Activate_MSwitchcmds' && $aVal == 1 ) {
addToAttrList('MSwitchcmd');
@ -2652,6 +2646,7 @@ sub MSwitch_Attr(@) {
. __LINE__ );
}
}
#############
@ -2672,12 +2667,6 @@ sub MSwitch_Attr(@) {
MSwitch_Clear_timer($hash);
delete( $hash->{helper}{savemodeblock} );
delete( $hash->{READINGS}{Safemode} );
my $notedef = ReadingsVal( $name, 'Trigger_device', 'no_trigger' );
if ($notedef eq "MSwitch_Self" ) {$notedef = $name}
$hash->{NOTIFYDEV} = $notedef;
}
if ( $testarg eq 'MSwitch_Reset_EVT_CMD1_COUNT' ) {