mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
Unit,UConv: smaller fixes
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@19548 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
184638c95f
commit
401b83f7fe
@ -1,18 +1,22 @@
|
|||||||
###############################################################################
|
###############################################################################
|
||||||
# $Id$
|
# $Id$
|
||||||
package main;
|
package main;
|
||||||
use strict;
|
|
||||||
use warnings;
|
|
||||||
use Data::Dumper;
|
|
||||||
|
|
||||||
#use FHEM::Meta;
|
# only to suppress file reload error in FHEM
|
||||||
sub UConv_Initialize() { }
|
sub UConv_Initialize() { }
|
||||||
|
|
||||||
package UConv;
|
package UConv;
|
||||||
|
use strict;
|
||||||
|
use warnings;
|
||||||
|
# use locale;
|
||||||
|
use POSIX;
|
||||||
|
|
||||||
|
use Time::Local;
|
||||||
use Scalar::Util qw(looks_like_number);
|
use Scalar::Util qw(looks_like_number);
|
||||||
use POSIX qw(strftime);
|
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
|
|
||||||
|
# require "95_Astro.pm";
|
||||||
|
|
||||||
sub GetSeason (;$$$);
|
sub GetSeason (;$$$);
|
||||||
sub _GetSeasonPheno ($$;$$);
|
sub _GetSeasonPheno ($$;$$);
|
||||||
sub _ReplaceStringByHashKey($$;$);
|
sub _ReplaceStringByHashKey($$;$);
|
||||||
@ -895,7 +899,7 @@ sub distance($$$$;$$) {
|
|||||||
my $km = $r * $c;
|
my $km = $r * $c;
|
||||||
|
|
||||||
return _round(
|
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 ($$;$) {
|
sub duration ($$;$) {
|
||||||
@ -1789,7 +1793,7 @@ sub _GetSeasonPheno ($$;$$) {
|
|||||||
60.161880, 24.937267
|
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 =
|
my $earlySpringBegin =
|
||||||
main::time_str2num( $ret->{year} . '-09-01 00:00:00' );
|
main::time_str2num( $ret->{year} . '-09-01 00:00:00' );
|
||||||
my $days = ( $time - $earlySpringBegin ) / ( 60 * 60 * 24 );
|
my $days = ( $time - $earlySpringBegin ) / ( 60 * 60 * 24 );
|
||||||
|
@ -3,12 +3,15 @@
|
|||||||
package main;
|
package main;
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
# use locale;
|
||||||
|
use POSIX;
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
use utf8;
|
use utf8;
|
||||||
use Encode qw(encode_utf8 decode_utf8);
|
use Encode qw(encode_utf8 decode_utf8);
|
||||||
|
|
||||||
use UConv;
|
use UConv;
|
||||||
|
|
||||||
|
# only to suppress file reload error in FHEM
|
||||||
sub Unit_Initialize() { }
|
sub Unit_Initialize() { }
|
||||||
|
|
||||||
# scale helper for metric numbers
|
# scale helper for metric numbers
|
||||||
|
Loading…
x
Reference in New Issue
Block a user