From 17f67a8f761dbab9a96c7d809ea0617426ed1983 Mon Sep 17 00:00:00 2001 From: betateilchen Date: Thu, 19 Sep 2013 17:02:58 +0000 Subject: [PATCH] changed: make use of JSON decoding optional git-svn-id: https://svn.fhem.de/fhem/trunk@3926 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_openweathermap.pm | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/fhem/FHEM/98_openweathermap.pm b/fhem/FHEM/98_openweathermap.pm index e83e98217..2fc1fd993 100644 --- a/fhem/FHEM/98_openweathermap.pm +++ b/fhem/FHEM/98_openweathermap.pm @@ -61,35 +61,8 @@ package main; use strict; use warnings; 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; - -# -############################################################################## - +eval {require JSON}; use feature qw/say switch/; require LWP::UserAgent; # test @@ -361,6 +334,7 @@ OWO_Define($$){ $hash->{helper}{AVAILABLE} = 1; $attr{$name}{"owoDebug"} = 1; + $attr{$name}{"owoUseXml"} = 1; $attr{$name}{"owoInterval"} = 1800; $attr{$name}{"owoGetUrl"} = "http://api.openweathermap.org/data/2.5/weather"; $attr{$name}{"owoSendUrl"} = "http://openweathermap.org/data/post";