From 1ecac8e995b35dd46f6eee48837b4632016e7563 Mon Sep 17 00:00:00 2001 From: xusader <> Date: Thu, 10 Sep 2015 18:40:58 +0000 Subject: [PATCH] 70_PushNotifier.pm: bugfix regex deviceID git-svn-id: https://svn.fhem.de/fhem/trunk@9226 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/70_PushNotifier.pm | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) 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");