mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
98_Hyperion.pm: use decode_json instead of from_json
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@13366 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
78fb1e5e19
commit
93003cbe2c
@ -90,7 +90,7 @@ sub Hyperion_Define($$)
|
|||||||
}
|
}
|
||||||
$hash->{IP} = $host;
|
$hash->{IP} = $host;
|
||||||
$hash->{PORT} = $port;
|
$hash->{PORT} = $port;
|
||||||
$hash->{DeviceName} = $host.":".$port;
|
$hash->{DeviceName} = "$host:$port";
|
||||||
$interval = undef unless defined $interval;
|
$interval = undef unless defined $interval;
|
||||||
$interval = 5 if ($interval && $interval < 5);
|
$interval = 5 if ($interval && $interval < 5);
|
||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
@ -232,7 +232,7 @@ sub Hyperion_Read($)
|
|||||||
}
|
}
|
||||||
elsif ($result =~ /^\{"info":\{.+\},"success":true\}$/)
|
elsif ($result =~ /^\{"info":\{.+\},"success":true\}$/)
|
||||||
{
|
{
|
||||||
my $obj = eval {from_json($result)};
|
my $obj = eval {decode_json($result)};
|
||||||
my $data = $obj->{info};
|
my $data = $obj->{info};
|
||||||
if (AttrVal($name,"hyperionVersionCheck",1) == 1)
|
if (AttrVal($name,"hyperionVersionCheck",1) == 1)
|
||||||
{
|
{
|
||||||
@ -602,7 +602,7 @@ sub Hyperion_Set($@)
|
|||||||
{
|
{
|
||||||
return "Effect $value is not available in the effect list of $name!"
|
return "Effect $value is not available in the effect list of $name!"
|
||||||
if ($value !~ /^([\w-]+)$/ || index(ReadingsVal($name,".effects",""),$value) == -1);
|
if ($value !~ /^([\w-]+)$/ || index(ReadingsVal($name,".effects",""),$value) == -1);
|
||||||
my $arg = $args[3]?eval{from_json $args[3]}:"";
|
my $arg = $args[3] ? eval{decode_json $args[3]} : "";
|
||||||
my $ce = $hash->{helper}{customeffects};
|
my $ce = $hash->{helper}{customeffects};
|
||||||
if (!$arg && $ce)
|
if (!$arg && $ce)
|
||||||
{
|
{
|
||||||
@ -826,12 +826,12 @@ sub Hyperion_Attr(@)
|
|||||||
{
|
{
|
||||||
foreach my $eff (@custeffs)
|
foreach my $eff (@custeffs)
|
||||||
{
|
{
|
||||||
push @effs,eval{from_json $eff};
|
push @effs,eval{decode_json $eff};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
push @effs,eval{from_json $attr_value};
|
push @effs,eval{decode_json $attr_value};
|
||||||
}
|
}
|
||||||
$hash->{helper}{customeffects} = \@effs;
|
$hash->{helper}{customeffects} = \@effs;
|
||||||
Hyperion_Call($hash);
|
Hyperion_Call($hash);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user