From 3e12114f92e27efa6403aa811cf246e1fe431fc4 Mon Sep 17 00:00:00 2001 From: deespe <> Date: Sat, 27 Aug 2016 02:33:59 +0000 Subject: [PATCH] 98_Hyperion: fix for crash bug git-svn-id: https://svn.fhem.de/fhem/trunk@12075 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_Hyperion.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fhem/FHEM/98_Hyperion.pm b/fhem/FHEM/98_Hyperion.pm index f9d339e8f..7f74ac75d 100644 --- a/fhem/FHEM/98_Hyperion.pm +++ b/fhem/FHEM/98_Hyperion.pm @@ -216,14 +216,14 @@ sub Hyperion_Read($) fhem "sleep 1; get $name statusRequest" if (AttrVal($name,"queryAfterSet",1) == 1 || !$hash->{INTERVAL}); return undef; } - elsif ($1 =~ /^.+"success":true\}$/) + elsif ($1 =~ /^.+\},"success":true\}$/) { ###################### # delete old reading # fhem "deletereading $name previous_mode" if (defined(ReadingsVal($name,"previous_mode",undef))); ###################### - my $obj = eval {from_json($result)}; - my $data = $obj->{info}; + my $obj = eval {from_json($result)}; + my $data = $obj->{info}; my $prio = (defined($data->{priorities}->[0]->{priority})) ? $data->{priorities}->[0]->{priority} : undef; my $duration = (defined($data->{priorities}->[0]->{duration_ms}) && $data->{priorities}->[0]->{duration_ms} > 999) ? int($data->{priorities}->[0]->{duration_ms} / 1000) : 0; $duration = ($duration) >= 1 ? $duration : "infinite";