mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
59_Weather: return missing perl modules message
git-svn-id: https://svn.fhem.de/fhem/trunk@27178 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
23af086689
commit
c1b5e245d6
@ -1,5 +1,6 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- bugfix: 59_Weather: return missing perl modules message
|
||||
- bugfix: 59_Weather: fix Undefined subroutine
|
||||
- feature: 74_AutomowerConnect: rework detail view
|
||||
getter for MowerData and StatisticsData
|
||||
|
@ -32,9 +32,18 @@ package FHEM::Core::Weather;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Time::HiRes qw(gettimeofday);
|
||||
my $missingModul = '';
|
||||
|
||||
eval { use Time::HiRes qw /gettimeofday/; 1 }
|
||||
or $missingModul .= "libtime-hires-perl ";
|
||||
|
||||
eval { use Readonly; 1 }
|
||||
or $missingModul .= "libreadonly-perl ";
|
||||
|
||||
#use Time::HiRes qw(gettimeofday);
|
||||
use experimental qw /switch/;
|
||||
use Readonly;
|
||||
|
||||
#use Readonly;
|
||||
|
||||
use FHEM::Meta;
|
||||
|
||||
@ -318,7 +327,6 @@ sub _ReturnWithError {
|
||||
}
|
||||
|
||||
sub DeleteForecastreadings {
|
||||
|
||||
my $hash = shift;
|
||||
|
||||
my $name = $hash->{NAME};
|
||||
@ -769,6 +777,12 @@ sub Define {
|
||||
return $@ unless ( FHEM::Meta::SetInternals($hash) );
|
||||
use version 0.60; our $VERSION = FHEM::Meta::Get( $hash, 'version' );
|
||||
|
||||
return
|
||||
'Cannot define Weather device. Please use "apt install '
|
||||
. ${missingModul}
|
||||
. ' to install missing perl modules'
|
||||
if ($missingModul);
|
||||
|
||||
my $usage =
|
||||
"syntax: define <name> Weather [API=<API>] [apikey=<apikey>] [location=<location>] [interval=<interval>] [lang=<lang>]";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user