2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 16:59:18 +00:00

98_MSwitch.pm:Fix - Fix reading "last_activation_by" - triggered by timer

git-svn-id: https://svn.fhem.de/fhem/trunk@18886 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Byte09 2019-03-13 04:49:25 +00:00
parent 730196eeda
commit c167073fc6

View File

@ -83,7 +83,7 @@ if ( $preconf && $preconf ne "" ) {
}
my $autoupdate = 'off'; #off/on
my $version = '2.12';
my $version = '2.11';
my $vupdate = 'V2.00'
; # versionsnummer der datenstruktur . änderung der nummer löst MSwitch_VUpdate aus .
my $savecount = 30
@ -916,7 +916,10 @@ sub MSwitch_Set($@) {
my $execids = "0";
$hash->{eventsave} = 'unsaved';
##############################
my $ic = 'leer';
$ic = $hash->{IncommingHandle} if ($hash->{IncommingHandle});
#####################
my $showevents = AttrVal( $name, "MSwitch_generate_Events", 1 );
@ -984,6 +987,16 @@ sub MSwitch_Set($@) {
return "Unknown argument $cmd, choose one of ";
}
# bearbeite setlist und readinglist
##############################
if ( $cmd ne "?" ) {
@ -1013,8 +1026,8 @@ sub MSwitch_Set($@) {
}
#######################################
my $ic = '';
$ic = $hash->{IncommingHandle};
# my $ic = '';
# $ic = $hash->{IncommingHandle};
if ( ( ( $cmd eq 'on' ) || ( $cmd eq 'off' ) )
&& ( $args[0] ne '' )
&& ( $ic ne 'fromnotify' ) )
@ -1633,7 +1646,12 @@ MSwitch_Exec_Notif( $hash, 'on', 'nocheck', '', 0 );
MSwitch_Delete_Delay( $hash, $name );
}
############
if ( $ic ne 'fromnotify' && $ic ne 'fromtimer') {
readingsSingleUpdate( $hash, "last_activation_by", 'manual', $showevents );
}
delete( $hash->{IncommingHandle} );
# ausführen des off befehls
my $zweig = 'nicht definiert';
$zweig = "cmd1" if $cmd eq "on";
@ -7673,6 +7691,7 @@ my $showevents = AttrVal( $Name, "MSwitch_generate_Events", 1 );
return;
}
$hash->{IncommingHandle} = 'fromtimer';
readingsSingleUpdate( $hash, "last_activation_by", 'timer', $showevents );
if ( AttrVal( $Name, 'MSwitch_RandomNumber', '' ) ne '' ) {