2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-08 13:24:56 +00:00

50_HP1000: fix UTF8 encoding

git-svn-id: https://svn.fhem.de/fhem/trunk@12670 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2016-11-27 12:05:49 +00:00
parent 8592911615
commit 8f22a8fba3

View File

@ -30,6 +30,8 @@ use strict;
use warnings;
use vars qw(%data);
use HttpUtils;
use utf8;
use Encode qw(encode_utf8 decode_utf8);
use Unit;
use Time::Local;
use List::Util qw(sum);
@ -76,12 +78,13 @@ sub HP1000_Initialize($) {
$hash->{readingsDesc} = {
'Activity' => { rtype => 'oknok', },
'UV' => { rtype => 'uvi', },
'UVcondition' => { rtype => 'condition_uvi', },
'UVR' => { rtype => 'uwpscm', },
'UVcondition' => { rtype => 'condition_uvi', },
'condition' => { rtype => 'condition_weather', },
'daylight' => { rtype => 'yesno', },
'dewpoint' => { rtype => 'c', formula_symbol => 'Td', },
'dewpoint_f' => { rtype => 'f', formula_symbol => 'Td', },
'extsrv_state' => { rtype => 'oknok', },
'humidity' => { rtype => 'pct', formula_symbol => 'H', },
'humidityAbs' => { rtype => 'c', formula_symbol => 'Tabs', },
'humidityAbs_f' => { rtype => 'f', formula_symbol => 'Tabs', },
@ -119,9 +122,10 @@ sub HP1000_Initialize($) {
'wind_compasspoint_avg2m' => { rtype => 'compasspoint', },
'wind_chill' => { rtype => 'c', formula_symbol => 'Wc', },
'wind_chill_f' => { rtype => 'f', formula_symbol => 'Wc', },
'wind_direction' => { rtype => 'direction', formula_symbol => 'Wdir', },
'wind_direction' =>
{ rtype => 'compasspoint', formula_symbol => 'Wdir', },
'wind_direction_avg2m' =>
{ rtype => 'direction', formula_symbol => 'Wdir', },
{ rtype => 'compasspoint', formula_symbol => 'Wdir', },
'wind_gust' => { rtype => 'kmh', formula_symbol => 'Wg', },
'wind_gust_bft' => { rtype => 'bft', formula_symbol => 'Wg', },
'wind_gust_fts' => { rtype => 'fts', formula_symbol => 'Wg', },
@ -140,6 +144,7 @@ sub HP1000_Initialize($) {
'wind_speed_mph_avg2m' => { rtype => 'mph', formula_symbol => 'W', },
'wind_speed_mps' => { rtype => 'mps', formula_symbol => 'W', },
'wind_speed_mps_avg2m' => { rtype => 'mps', formula_symbol => 'W', },
'wu_state' => { rtype => 'oknok', },
};
}
@ -340,7 +345,7 @@ sub HP1000_CGI() {
$pv =~ s/%([\dA-F][\dA-F])/chr(hex($1))/ige;
my ( $p, $v ) = split( "=", $pv, 2 );
$webArgs->{$p} = $v;
$webArgs->{$p} = $v ne "" ? Encode::encode_utf8($v) : $v;
}
if ( !defined( $webArgs->{softwaretype} )