fix: missing perl modules
This commit is contained in:
@ -32,7 +32,7 @@ package FHEM::Core::Weather;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
my $missingModul = 'apt install';
|
||||
my $missingModul = '';
|
||||
|
||||
eval { use Time::HiRes qw /gettimeofday/; 1 }
|
||||
or $missingModul .= "libtime-hires-perl ";
|
||||
@ -777,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>]";
|
||||
|
||||
|
Reference in New Issue
Block a user