diff --git a/FHEM/UConv.pm b/FHEM/UConv.pm index 535c5af8e..7a8b95637 100644 --- a/FHEM/UConv.pm +++ b/FHEM/UConv.pm @@ -1,18 +1,22 @@ ############################################################################### # $Id$ package main; -use strict; -use warnings; -use Data::Dumper; -#use FHEM::Meta; +# only to suppress file reload error in FHEM sub UConv_Initialize() { } package UConv; +use strict; +use warnings; +# use locale; +use POSIX; + +use Time::Local; use Scalar::Util qw(looks_like_number); -use POSIX qw(strftime); use Data::Dumper; +# require "95_Astro.pm"; + sub GetSeason (;$$$); sub _GetSeasonPheno ($$;$$); sub _ReplaceStringByHashKey($$;$); @@ -895,7 +899,7 @@ sub distance($$$$;$$) { my $km = $r * $c; return _round( - ( $unit eq "nmi" ? km2nmi($km) : ( $unit ? km2mi($km) : $km ) ), $rnd ); + ( $unit && $unit eq "nmi" ? km2nmi($km) : ( $unit ? km2mi($km) : $km ) ), $rnd ); } sub duration ($$;$) { @@ -1789,7 +1793,7 @@ sub _GetSeasonPheno ($$;$$) { 60.161880, 24.937267 ); - # TODO: let begin of early autumn be set by user + # TODO: let begin of early fall be set by user my $earlySpringBegin = main::time_str2num( $ret->{year} . '-09-01 00:00:00' ); my $days = ( $time - $earlySpringBegin ) / ( 60 * 60 * 24 ); diff --git a/FHEM/Unit.pm b/FHEM/Unit.pm index 3c042deaa..f00c5cc64 100644 --- a/FHEM/Unit.pm +++ b/FHEM/Unit.pm @@ -3,12 +3,15 @@ package main; use strict; use warnings; +# use locale; +use POSIX; use Data::Dumper; use utf8; use Encode qw(encode_utf8 decode_utf8); use UConv; +# only to suppress file reload error in FHEM sub Unit_Initialize() { } # scale helper for metric numbers