"rebase" push
This commit is contained in:
parent
d2c7b53241
commit
0c53e0de2d
@ -24,6 +24,7 @@
|
|||||||
#
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
package FHEM::HailoLibero;
|
package FHEM::HailoLibero;
|
||||||
|
|
||||||
use strict;
|
use strict;
|
||||||
@ -32,10 +33,11 @@ use warnings;
|
|||||||
use GPUtils qw(GP_Import GP_Export);
|
use GPUtils qw(GP_Import GP_Export);
|
||||||
require FHEM::Hailo::Libero;
|
require FHEM::Hailo::Libero;
|
||||||
|
|
||||||
|
|
||||||
## Import der FHEM Funktionen
|
## Import der FHEM Funktionen
|
||||||
#-- Run before package compilation
|
#-- Run before package compilation
|
||||||
BEGIN {
|
BEGIN {
|
||||||
|
|
||||||
# Import from main context
|
# Import from main context
|
||||||
GP_Import(
|
GP_Import(
|
||||||
qw(
|
qw(
|
||||||
@ -74,13 +76,14 @@ sub Initialize {
|
|||||||
return FHEM::Meta::InitMod( __FILE__, $hash );
|
return FHEM::Meta::InitMod( __FILE__, $hash );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
=pod
|
=pod
|
||||||
|
|
||||||
=item device
|
=item device
|
||||||
=item summary Modul to communicate with the Hailo Libero
|
=item summary Modul to communicate with the GardenaCloud
|
||||||
=item summary_DE Modul zur Datenübertragung zur Hailo Libero
|
=item summary_DE Modul zur Datenübertragung zur GardenaCloud
|
||||||
|
|
||||||
=begin html
|
=begin html
|
||||||
|
|
||||||
|
0
controls_GardenaSmart.txt
Normal file
0
controls_GardenaSmart.txt
Normal file
@ -5,11 +5,11 @@ use POSIX qw(strftime);
|
|||||||
use strict;
|
use strict;
|
||||||
|
|
||||||
my @filenames = (
|
my @filenames = (
|
||||||
'FHEM/73_HailoLibero.pm',
|
'FHEM/73_GardenaSmartBridge2.pm',
|
||||||
'lib/FHEM/Hailo/Libero.pm',
|
'lib/FHEM/Gardena/SmartBridge.pm',
|
||||||
);
|
);
|
||||||
|
|
||||||
my $controlsfile = 'controls_HailoLibero.txt';
|
my $controlsfile = 'controls_GardenaSmart.txt';
|
||||||
|
|
||||||
open(FH, ">$controlsfile") || return("Can't open $controlsfile: $!");
|
open(FH, ">$controlsfile") || return("Can't open $controlsfile: $!");
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ use warnings;
|
|||||||
use FHEM::Meta;
|
use FHEM::Meta;
|
||||||
use GPUtils qw(GP_Import);
|
use GPUtils qw(GP_Import);
|
||||||
use HttpUtils;
|
use HttpUtils;
|
||||||
use FHEM::Core::Authentication::Passwords qw(:ALL);
|
use FHEM::Core::Password::Utils qw(:ALL);
|
||||||
|
|
||||||
|
|
||||||
my $missingModul = '';
|
my $missingModul = '';
|
||||||
@ -83,7 +83,7 @@ sub Define {
|
|||||||
my $name = shift @$aArg;
|
my $name = shift @$aArg;
|
||||||
$hash->{VERSION} = version->parse($VERSION)->normal;
|
$hash->{VERSION} = version->parse($VERSION)->normal;
|
||||||
|
|
||||||
CommandAttr( undef, $name . ' room Hailo' )
|
CommandAttr( undef, $name . ' room Haeilo' )
|
||||||
if ( AttrVal( $name, 'room', 'none' ) eq 'none' );
|
if ( AttrVal( $name, 'room', 'none' ) eq 'none' );
|
||||||
|
|
||||||
readingsSingleUpdate( $hash, 'state', 'initialized', 1 );
|
readingsSingleUpdate( $hash, 'state', 'initialized', 1 );
|
||||||
@ -91,7 +91,7 @@ sub Define {
|
|||||||
Log3($name, 3, qq{HailoLibero ($name) - defined HailoLibero});
|
Log3($name, 3, qq{HailoLibero ($name) - defined HailoLibero});
|
||||||
|
|
||||||
### create password object to handle pass keystore
|
### create password object to handle pass keystore
|
||||||
$hash->{helper}->{passObj} = FHEM::Core::Authentication::Passwords->new($hash->{TYPE});
|
$hash->{helper}->{passObj} = FHEM::Core::Password::Utils->new();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -124,6 +124,8 @@ sub Attr {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sub Set {
|
sub Set {
|
||||||
my $hash = shift // return;
|
my $hash = shift // return;
|
||||||
my $aArg = shift // return;
|
my $aArg = shift // return;
|
||||||
@ -146,11 +148,11 @@ sub Set {
|
|||||||
return q{password successfully saved}
|
return q{password successfully saved}
|
||||||
if ( defined($passResp)
|
if ( defined($passResp)
|
||||||
and !defined($passErr) );
|
and !defined($passErr) );
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
|
||||||
my $list = "hailopwd "
|
my $list = "hailopwd "
|
||||||
if ( ! defined( ReadPassword( $hash, $name ) ) );
|
|
||||||
return "Unknown argument $cmd, choose one of $list";
|
return "Unknown argument $cmd, choose one of $list";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -237,35 +239,18 @@ sub WriteReadings {
|
|||||||
####################################
|
####################################
|
||||||
#### my little helpers Sub's #######
|
#### my little helpers Sub's #######
|
||||||
|
|
||||||
sub ReadPassword {
|
s
|
||||||
my $hash = shift;
|
|
||||||
my $name = shift;
|
|
||||||
|
|
||||||
my $password;
|
|
||||||
|
|
||||||
Log3 $name, 4, "Hail ($name) - Read password from file";
|
|
||||||
$password = $hash->{helper}->{passObj}->getReadPassword($name);
|
|
||||||
|
|
||||||
if ( defined($password) ) {
|
|
||||||
return $password;
|
|
||||||
} else {
|
|
||||||
Log3 $name, 3, "Hail ($name) - No password in file";
|
|
||||||
return undef;
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
sub Rename {
|
sub Rename {
|
||||||
my $new = shift;
|
my $new = shift;
|
||||||
my $old = shift;
|
my $old = shift;
|
||||||
|
|
||||||
my $hash = $defs{$new};
|
|
||||||
|
|
||||||
$hash->{helper}->{passObj}->getRename($new,$old);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sub createHttpValueStrings {
|
sub createHttpValueStrings {
|
||||||
my ( $hash, $payload ) = @_;
|
my ( $hash, $payload ) = @_;
|
||||||
|
|
||||||
@ -280,51 +265,3 @@ sub createHttpValueStrings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
=pod
|
|
||||||
=for :application/json;q=META.json Libero.pm
|
|
||||||
{
|
|
||||||
"abstract": "Modul to control Hailo Libero 3.0",
|
|
||||||
"x_lang": {
|
|
||||||
"de": {
|
|
||||||
"abstract": "Modul zum bedienen des Hailo Libero 3.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"fhem-mod-device",
|
|
||||||
"fhem-core",
|
|
||||||
"Hailo",
|
|
||||||
"Libero",
|
|
||||||
"Smart"
|
|
||||||
],
|
|
||||||
"release_status": "stable",
|
|
||||||
"license": "GPL_2",
|
|
||||||
"version": "v1.0.0",
|
|
||||||
"author": [
|
|
||||||
"Sebastian Schwarz <ema@il.local>"
|
|
||||||
],
|
|
||||||
"x_fhem_maintainer": [
|
|
||||||
"CoolTux"
|
|
||||||
],
|
|
||||||
"x_fhem_maintainer_github": [
|
|
||||||
"LeonGaultier"
|
|
||||||
],
|
|
||||||
"prereqs": {
|
|
||||||
"runtime": {
|
|
||||||
"requires": {
|
|
||||||
"FHEM": 5.00918799,
|
|
||||||
"perl": 5.016,
|
|
||||||
"Meta": 0,
|
|
||||||
"HttpUtils": 0,
|
|
||||||
"Encode": 0
|
|
||||||
},
|
|
||||||
"recommends": {
|
|
||||||
},
|
|
||||||
"suggests": {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
=end :application/json;q=META.json
|
|
||||||
|
|
||||||
=cut
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user