mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 01:06:04 +00:00
changed: make use of JSON decoding optional
git-svn-id: https://svn.fhem.de/fhem/trunk@3926 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
08cf663635
commit
0f797dfc8d
@ -61,35 +61,8 @@ package main;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use POSIX;
|
use POSIX;
|
||||||
|
|
||||||
##############################################################################
|
|
||||||
#
|
|
||||||
# IMPORTANT !
|
|
||||||
#
|
|
||||||
# This module can handle JSON and XML data to decode weather data.
|
|
||||||
#
|
|
||||||
# If you do not have JSON installed on your system or if you CAN NOT install
|
|
||||||
# JSON (e.g. on Fritzbox) you MUST NOT deactivate the following "use JSON".
|
|
||||||
#
|
|
||||||
# Instead, create a dummy file named "JSON.pm" an put it
|
|
||||||
# into your Perl installation directory.
|
|
||||||
# This file should contain only one line of coding, that will be
|
|
||||||
#
|
|
||||||
# return 1;
|
|
||||||
#
|
|
||||||
# After this you can restart fhem and create an owo device.
|
|
||||||
# You MUST set attribute "owoUseXml" to 1 in this device,
|
|
||||||
# before retrieving any data via owo API
|
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
#
|
|
||||||
|
|
||||||
use JSON;
|
|
||||||
use XML::Simple;
|
use XML::Simple;
|
||||||
|
eval {require JSON};
|
||||||
#
|
|
||||||
##############################################################################
|
|
||||||
|
|
||||||
use feature qw/say switch/;
|
use feature qw/say switch/;
|
||||||
|
|
||||||
require LWP::UserAgent; # test
|
require LWP::UserAgent; # test
|
||||||
@ -361,6 +334,7 @@ OWO_Define($$){
|
|||||||
$hash->{helper}{AVAILABLE} = 1;
|
$hash->{helper}{AVAILABLE} = 1;
|
||||||
|
|
||||||
$attr{$name}{"owoDebug"} = 1;
|
$attr{$name}{"owoDebug"} = 1;
|
||||||
|
$attr{$name}{"owoUseXml"} = 1;
|
||||||
$attr{$name}{"owoInterval"} = 1800;
|
$attr{$name}{"owoInterval"} = 1800;
|
||||||
$attr{$name}{"owoGetUrl"} = "http://api.openweathermap.org/data/2.5/weather";
|
$attr{$name}{"owoGetUrl"} = "http://api.openweathermap.org/data/2.5/weather";
|
||||||
$attr{$name}{"owoSendUrl"} = "http://openweathermap.org/data/post";
|
$attr{$name}{"owoSendUrl"} = "http://openweathermap.org/data/post";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user