"rebase" push

This commit is contained in:
Sebastian 2021-05-25 20:25:39 +02:00
parent d2c7b53241
commit 0c53e0de2d
4 changed files with 21 additions and 81 deletions

View File

@ -24,6 +24,7 @@
#
###############################################################################
package FHEM::HailoLibero;
use strict;
@ -32,10 +33,11 @@ use warnings;
use GPUtils qw(GP_Import GP_Export);
require FHEM::Hailo::Libero;
## Import der FHEM Funktionen
#-- Run before package compilation
BEGIN {
# Import from main context
GP_Import(
qw(
@ -74,13 +76,14 @@ sub Initialize {
return FHEM::Meta::InitMod( __FILE__, $hash );
}
1;
=pod
=item device
=item summary Modul to communicate with the Hailo Libero
=item summary_DE Modul zur Datenübertragung zur Hailo Libero
=item summary Modul to communicate with the GardenaCloud
=item summary_DE Modul zur Datenübertragung zur GardenaCloud
=begin html

View File

View File

@ -5,11 +5,11 @@ use POSIX qw(strftime);
use strict;
my @filenames = (
'FHEM/73_HailoLibero.pm',
'lib/FHEM/Hailo/Libero.pm',
'FHEM/73_GardenaSmartBridge2.pm',
'lib/FHEM/Gardena/SmartBridge.pm',
);
my $controlsfile = 'controls_HailoLibero.txt';
my $controlsfile = 'controls_GardenaSmart.txt';
open(FH, ">$controlsfile") || return("Can't open $controlsfile: $!");

View File

@ -33,7 +33,7 @@ use warnings;
use FHEM::Meta;
use GPUtils qw(GP_Import);
use HttpUtils;
use FHEM::Core::Authentication::Passwords qw(:ALL);
use FHEM::Core::Password::Utils qw(:ALL);
my $missingModul = '';
@ -83,7 +83,7 @@ sub Define {
my $name = shift @$aArg;
$hash->{VERSION} = version->parse($VERSION)->normal;
CommandAttr( undef, $name . ' room Hailo' )
CommandAttr( undef, $name . ' room Haeilo' )
if ( AttrVal( $name, 'room', 'none' ) eq 'none' );
readingsSingleUpdate( $hash, 'state', 'initialized', 1 );
@ -91,7 +91,7 @@ sub Define {
Log3($name, 3, qq{HailoLibero ($name) - defined HailoLibero});
### 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;
}
@ -124,6 +124,8 @@ sub Attr {
return;
}
sub Set {
my $hash = shift // return;
my $aArg = shift // return;
@ -146,11 +148,11 @@ sub Set {
return q{password successfully saved}
if ( defined($passResp)
and !defined($passErr) );
}
}
else {
my $list = "hailopwd "
if ( ! defined( ReadPassword( $hash, $name ) ) );
return "Unknown argument $cmd, choose one of $list";
}
@ -237,35 +239,18 @@ sub WriteReadings {
####################################
#### my little helpers Sub's #######
sub ReadPassword {
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;
}
s
sub Rename {
my $new = shift;
my $old = shift;
my $new = shift;
my $old = shift;
my $hash = $defs{$new};
$hash->{helper}->{passObj}->getRename($new,$old);
return;
}
sub createHttpValueStrings {
my ( $hash, $payload ) = @_;
@ -280,51 +265,3 @@ sub createHttpValueStrings {
}
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