diff --git a/FHEM/73_HailoLibero.pm b/FHEM/73_HailoLibero.pm index fdaa7fd..c04a931 100644 --- a/FHEM/73_HailoLibero.pm +++ b/FHEM/73_HailoLibero.pm @@ -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 diff --git a/controls_GardenaSmart.txt b/controls_GardenaSmart.txt new file mode 100644 index 0000000..e69de29 diff --git a/hooks/pre-commit b/hooks/pre-commit index 020034e..823f1a5 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -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: $!"); diff --git a/lib/FHEM/Hailo/Libero.pm b/lib/FHEM/Hailo/Libero.pm index dfb40ad..f3637dd 100644 --- a/lib/FHEM/Hailo/Libero.pm +++ b/lib/FHEM/Hailo/Libero.pm @@ -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 " - ], - "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