diff --git a/FHEM/73_HailoLibero.pm b/FHEM/73_HailoLibero.pm index 5f2a576..fdaa7fd 100644 --- a/FHEM/73_HailoLibero.pm +++ b/FHEM/73_HailoLibero.pm @@ -35,7 +35,7 @@ require FHEM::Hailo::Libero; ## Import der FHEM Funktionen #-- Run before package compilation BEGIN { - + # Import from main context GP_Import( qw( diff --git a/controls_HailiLibero.txt b/controls_HailiLibero.txt index b7df995..0fad451 100644 --- a/controls_HailiLibero.txt +++ b/controls_HailiLibero.txt @@ -1,2 +1,2 @@ -UPD 2021-05-17_20:04:35 4327 FHEM/73_HailoLibero.pm -UPD 2021-05-17_20:13:25 6449 lib/FHEM/Hailo/Libero.pm +UPD 2021-05-18_19:37:32 4328 FHEM/73_HailoLibero.pm +UPD 2021-05-18_19:53:07 7810 lib/FHEM/Hailo/Libero.pm diff --git a/lib/FHEM/Hailo/Libero.pm b/lib/FHEM/Hailo/Libero.pm index 86cfe3a..dfb40ad 100644 --- a/lib/FHEM/Hailo/Libero.pm +++ b/lib/FHEM/Hailo/Libero.pm @@ -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->{helper}->{passObj} = FHEM::Core::Authentication::Passwords->new($hash->{TYPE}); return; } @@ -149,7 +149,8 @@ sub Set { } else { - my $list = "hailopwd "; + my $list = "hailopwd " + if ( ! defined( ReadPassword( $hash, $name ) ) ); return "Unknown argument $cmd, choose one of $list"; } @@ -236,11 +237,32 @@ 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; +} + 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; } @@ -257,4 +279,52 @@ sub createHttpValueStrings { return ( $payload, $session_id, $header, $uri, $method ); } -1; \ No newline at end of file +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