mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-07 22:29:19 +00:00
30_HUEBridge.pm: use from_json instead of decode_json to avoid encoding problems. forum: http://forum.fhem.de/index.php/topic,29939.0.html
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@7215 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
a86b63a724
commit
758fee7dff
@ -13,7 +13,6 @@ use POSIX;
|
|||||||
use JSON;
|
use JSON;
|
||||||
#use Try::Tiny;
|
#use Try::Tiny;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
use MIME::Base64;
|
|
||||||
|
|
||||||
sub HUEBridge_Initialize($)
|
sub HUEBridge_Initialize($)
|
||||||
{
|
{
|
||||||
@ -61,7 +60,7 @@ HUEBridge_Define($$)
|
|||||||
|
|
||||||
if( defined($ret) && $ret ne '' )
|
if( defined($ret) && $ret ne '' )
|
||||||
{
|
{
|
||||||
my $obj = decode_json($ret);
|
my $obj = from_json($ret);
|
||||||
|
|
||||||
if( defined($obj->[0])
|
if( defined($obj->[0])
|
||||||
&& defined($obj->[0]->{'internalipaddress'}) ) {
|
&& defined($obj->[0]->{'internalipaddress'}) ) {
|
||||||
@ -421,12 +420,12 @@ sub HUEBridge_HTTP_Call($$$)
|
|||||||
}
|
}
|
||||||
|
|
||||||
# try {
|
# try {
|
||||||
# decode_json($ret);
|
# from_json($ret);
|
||||||
# } catch {
|
# } catch {
|
||||||
# return undef;
|
# return undef;
|
||||||
# }
|
# }
|
||||||
|
|
||||||
return HUEBridge_ProcessResponse($hash,decode_json($ret));
|
return HUEBridge_ProcessResponse($hash,from_json($ret));
|
||||||
}
|
}
|
||||||
|
|
||||||
#adapted version of the CustomGetFileFromURL subroutine from HttpUtils.pm
|
#adapted version of the CustomGetFileFromURL subroutine from HttpUtils.pm
|
||||||
|
Loading…
x
Reference in New Issue
Block a user