From 3a786216f69f73fee54f8e9c07ee7bb53e5ddc03 Mon Sep 17 00:00:00 2001 From: klassm Date: Mon, 26 Aug 2013 17:39:03 +0000 Subject: [PATCH] correct splitting of read states git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@3798 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/contrib/98_gcmsend.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fhem/contrib/98_gcmsend.pm b/fhem/contrib/98_gcmsend.pm index 240871e15..15981dc66 100644 --- a/fhem/contrib/98_gcmsend.pm +++ b/fhem/contrib/98_gcmsend.pm @@ -128,13 +128,15 @@ sub gcmsend_notify($$) my @keyValue = split(":", $dev->{CHANGED}[$i]); my $length = int($keyValue); + my $change = $dev->{CHANGED}[$i]; + my $position = index($change, ':'); - if ($length == 0) { + if ($position == -1) { $key = "state"; $value = $keyValue[0]; } else { - $key = @keyValue[0]; - $value = @keyValue[1]; + $key = substr($change, 0, $position); + $value = substr($change, $position + 2, length($change)); } if (