mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
98_MSwitch.pm:Fix - Fix reading "last_activation_by" - triggered by timer
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@18886 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
796294a834
commit
cad9eb0d23
@ -83,7 +83,7 @@ if ( $preconf && $preconf ne "" ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $autoupdate = 'off'; #off/on
|
my $autoupdate = 'off'; #off/on
|
||||||
my $version = '2.12';
|
my $version = '2.11';
|
||||||
my $vupdate = 'V2.00'
|
my $vupdate = 'V2.00'
|
||||||
; # versionsnummer der datenstruktur . änderung der nummer löst MSwitch_VUpdate aus .
|
; # versionsnummer der datenstruktur . änderung der nummer löst MSwitch_VUpdate aus .
|
||||||
my $savecount = 30
|
my $savecount = 30
|
||||||
@ -916,7 +916,10 @@ sub MSwitch_Set($@) {
|
|||||||
my $execids = "0";
|
my $execids = "0";
|
||||||
$hash->{eventsave} = 'unsaved';
|
$hash->{eventsave} = 'unsaved';
|
||||||
|
|
||||||
##############################
|
|
||||||
|
my $ic = 'leer';
|
||||||
|
$ic = $hash->{IncommingHandle} if ($hash->{IncommingHandle});
|
||||||
|
#####################
|
||||||
|
|
||||||
my $showevents = AttrVal( $name, "MSwitch_generate_Events", 1 );
|
my $showevents = AttrVal( $name, "MSwitch_generate_Events", 1 );
|
||||||
|
|
||||||
@ -984,6 +987,16 @@ sub MSwitch_Set($@) {
|
|||||||
return "Unknown argument $cmd, choose one of ";
|
return "Unknown argument $cmd, choose one of ";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# bearbeite setlist und readinglist
|
# bearbeite setlist und readinglist
|
||||||
##############################
|
##############################
|
||||||
if ( $cmd ne "?" ) {
|
if ( $cmd ne "?" ) {
|
||||||
@ -1013,8 +1026,8 @@ sub MSwitch_Set($@) {
|
|||||||
}
|
}
|
||||||
#######################################
|
#######################################
|
||||||
|
|
||||||
my $ic = '';
|
# my $ic = '';
|
||||||
$ic = $hash->{IncommingHandle};
|
# $ic = $hash->{IncommingHandle};
|
||||||
if ( ( ( $cmd eq 'on' ) || ( $cmd eq 'off' ) )
|
if ( ( ( $cmd eq 'on' ) || ( $cmd eq 'off' ) )
|
||||||
&& ( $args[0] ne '' )
|
&& ( $args[0] ne '' )
|
||||||
&& ( $ic ne 'fromnotify' ) )
|
&& ( $ic ne 'fromnotify' ) )
|
||||||
@ -1633,7 +1646,12 @@ MSwitch_Exec_Notif( $hash, 'on', 'nocheck', '', 0 );
|
|||||||
MSwitch_Delete_Delay( $hash, $name );
|
MSwitch_Delete_Delay( $hash, $name );
|
||||||
}
|
}
|
||||||
############
|
############
|
||||||
|
|
||||||
|
if ( $ic ne 'fromnotify' && $ic ne 'fromtimer') {
|
||||||
readingsSingleUpdate( $hash, "last_activation_by", 'manual', $showevents );
|
readingsSingleUpdate( $hash, "last_activation_by", 'manual', $showevents );
|
||||||
|
|
||||||
|
}
|
||||||
|
delete( $hash->{IncommingHandle} );
|
||||||
# ausführen des off befehls
|
# ausführen des off befehls
|
||||||
my $zweig = 'nicht definiert';
|
my $zweig = 'nicht definiert';
|
||||||
$zweig = "cmd1" if $cmd eq "on";
|
$zweig = "cmd1" if $cmd eq "on";
|
||||||
@ -7673,6 +7691,7 @@ my $showevents = AttrVal( $Name, "MSwitch_generate_Events", 1 );
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$hash->{IncommingHandle} = 'fromtimer';
|
||||||
readingsSingleUpdate( $hash, "last_activation_by", 'timer', $showevents );
|
readingsSingleUpdate( $hash, "last_activation_by", 'timer', $showevents );
|
||||||
|
|
||||||
if ( AttrVal( $Name, 'MSwitch_RandomNumber', '' ) ne '' ) {
|
if ( AttrVal( $Name, 'MSwitch_RandomNumber', '' ) ne '' ) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user