mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-07 12:58:13 +00:00
36_JeeLink.pm: check if LWP::UserAgent and HTTP::Request::Common are available
git-svn-id: https://svn.fhem.de/fhem/trunk@10847 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
848b25b1e8
commit
1ceebb3fdc
@ -7,8 +7,6 @@ use strict;
|
||||
use warnings;
|
||||
use Time::HiRes qw(gettimeofday);
|
||||
use Time::Local;
|
||||
use LWP::UserAgent;
|
||||
use HTTP::Request::Common;
|
||||
|
||||
sub JeeLink_Attr(@);
|
||||
sub JeeLink_Clear($);
|
||||
@ -250,13 +248,19 @@ JeeLink_Set($@)
|
||||
$log .= "hex file: $hexFile\n";
|
||||
|
||||
if($detectedFirmware eq "LaCrosseGateway.bin") {
|
||||
eval "use LWP::UserAgent";
|
||||
return "\nERROR: Please install LWP::UserAgent" if($@);
|
||||
|
||||
eval "use HTTP::Request::Common";
|
||||
return "\nERROR: Please install HTTP::Request::Common" if($@);
|
||||
|
||||
$log .= "Mode is LaCrosseGateway OTA-update\n";
|
||||
DevIo_CloseDev($hash);
|
||||
$hash->{STATE} = "disconnected";
|
||||
$log .= "$name closed\n";
|
||||
|
||||
my @spl = split(':', $hash->{DeviceName});
|
||||
my $targetIP = @spl[0];
|
||||
my $targetIP = $spl[0];
|
||||
my $targetURL = "http://" . $targetIP . "/ota/firmware.bin";
|
||||
$log .= "target: $targetURL\n";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user