mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
Unit,UConv: smaller fixes
git-svn-id: https://svn.fhem.de/fhem/trunk@19548 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
7e6efca126
commit
b3ad4d26ec
@ -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 );
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user