diff --git a/fhem/CHANGED b/fhem/CHANGED index be8de0ea2..0678d2767 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - bugfix: 70_PushNotifier: bugfix regex deviceID - feature: new Module 74_AMAD to request Information and control Android Devices in cooperation with AutomagicApp on the Device (Forum #39773) (by M. Oldenburg) diff --git a/fhem/FHEM/70_PushNotifier.pm b/fhem/FHEM/70_PushNotifier.pm index 76cf61d04..e894b83d1 100644 --- a/fhem/FHEM/70_PushNotifier.pm +++ b/fhem/FHEM/70_PushNotifier.pm @@ -1,5 +1,5 @@ ############################################### -#$Id: 70_PushNotifier.pm 2015-09-10 06:30:00 xusader +#$Id: 70_PushNotifier.pm 2015-09-10 20:30:00 xusader # # regex part by pirmanji # @@ -76,8 +76,7 @@ PushNotifier_Define($$) 'appToken' => $appToken]); my $strg_chkID = $responseID->as_string; - $strg_chkID =~ /\[(.*),(.*)\]/; - my $devIDs = $1; + (my $devIDs = $strg_chkID) =~ s/.*\{"status":.*,"devices":\[(.*)\]\}/$1/s; $devIDs =~ s/[-"{}_]//g; $hash->{devices} = $devIDs; @@ -108,7 +107,7 @@ PushNotifier_Send_Message my $mc=0; try { - while ($hash->{devices} =~ /title:(.*?),id:(\d+),model:(.*?)(?=,title:|\])/g) { + while ($hash->{devices} =~ /title:(.*?),id:(\d+),model:(.*?)(?=,title:|$)/g) { my ($nd_title, $nd_id, $nd_model) = ("$1", "$2", "$3"); # Log3 (undef, 3, "PushNotifier: Send Message $msg to device title: $nd_title, id: $nd_id, model: $nd_model");