2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-22 20:24:36 +00:00

98_Hyperion: fix #2 for crash bug

git-svn-id: https://svn.fhem.de/fhem/trunk@12079 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
deespe 2016-08-27 12:03:40 +00:00
parent 46c4eba507
commit aafc1faf83

View File

@ -207,16 +207,16 @@ sub Hyperion_Read($)
return undef if (!$buf);
my $result = ($hash->{PARTIAL}) ? $hash->{PARTIAL}.$buf : $buf;
$hash->{PARTIAL} = $result;
Log3 $name,5,"$name: url ".$hash->{DeviceName}." returned buf: $buf";
return undef if ($buf !~ /(^.+"success":(true|false)\}$)/ );
Log3 $name,5,"$name: url ".$hash->{DeviceName}." returned result: $result";
delete $hash->{PARTIAL};
my %Hyperion_sets_local = %Hyperion_sets;
if ($1 =~ /^\{"success":true\}$/)
if ($result=~ /^\{"success":true\}$/)
{
fhem "sleep 1; get $name statusRequest" if (AttrVal($name,"queryAfterSet",1) == 1 || !$hash->{INTERVAL});
return undef;
}
elsif ($1 =~ /^.+\},"success":true\}$/)
elsif ($result =~ /^\{"info":\{.+\},"success":true\}$/)
{
######################
if (defined(ReadingsVal($name,"previous_mode",undef)))