From a2e0461637aeb9158647902943c0a2621f01f5ab Mon Sep 17 00:00:00 2001 From: Byte09 <> Date: Mon, 31 Dec 2018 08:03:12 +0000 Subject: [PATCH] 98_MSwitch.pm:Fix - perlwarning if incoming event json formated git-svn-id: https://svn.fhem.de/fhem/trunk@18102 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_MSwitch.pm | 46 +++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/fhem/FHEM/98_MSwitch.pm b/fhem/FHEM/98_MSwitch.pm index 454b295c9..d3b76b642 100644 --- a/fhem/FHEM/98_MSwitch.pm +++ b/fhem/FHEM/98_MSwitch.pm @@ -2452,8 +2452,28 @@ sub MSwitch_Notify($$) { my $anzahl; EVENT: foreach my $event (@eventscopy) { - #MSwitch_LOG( $ownName, 0, "$ownName: event -> $event " ); + MSwitch_LOG( $ownName, 5, "$ownName: event -> $event " ); + + if( $event =~ m/(.*)(\{.*\})(.*)/ ) + { + + MSwitch_LOG( $ownName, 5, "$ownName: changedevent1 -> $1 " ); + MSwitch_LOG( $ownName, 5, "$ownName: changedevent2 -> $2 " ); + MSwitch_LOG( $ownName, 5, "$ownName: changedevent3 -> $3 " ); + my $p1 = $1; + my $json = $2; + my $p3 = $3; + $json =~ s/:/[dp]/g; + $json =~ s/\"/[dst]/g; + + $event = $p1.$json.$p3; + MSwitch_LOG( $ownName, 5, "$ownName: changedevent -> $event " ); + #next EVENT; + } + + + $own_hash->{eventsave} = 'unsaved'; MSwitch_LOG( $ownName, 5, "$ownName: eingehendes Event -> " @@ -4610,7 +4630,7 @@ sub MSwitch_fhemwebFn($$$$) { $ret = $ret . "Trigger Device Global Whitelist: