From eda1060eaacf8a08fe5bb25faeb3f80f3ed23641 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Sat, 27 Mar 2021 16:37:57 +0100 Subject: [PATCH] change set passwort fn code --- controls_TeslaPowerwall2AC.txt | 2 +- lib/FHEM/Tesla/Powerwall.pm | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/controls_TeslaPowerwall2AC.txt b/controls_TeslaPowerwall2AC.txt index f90c1bc..8aa3296 100644 --- a/controls_TeslaPowerwall2AC.txt +++ b/controls_TeslaPowerwall2AC.txt @@ -1,2 +1,2 @@ UPD 2021-03-27_15:47:11 6982 FHEM/46_TeslaPowerwall2AC.pm -UPD 2021-03-27_15:51:48 28787 lib/FHEM/Tesla/Powerwall.pm +UPD 2021-03-27_16:37:44 28867 lib/FHEM/Tesla/Powerwall.pm diff --git a/lib/FHEM/Tesla/Powerwall.pm b/lib/FHEM/Tesla/Powerwall.pm index e004aab..f2056d1 100644 --- a/lib/FHEM/Tesla/Powerwall.pm +++ b/lib/FHEM/Tesla/Powerwall.pm @@ -392,7 +392,8 @@ sub Set { elsif ( lc $cmd eq 'setpassword' ) { return q{please set Attribut emailaddr first} if ( AttrVal( $name, 'emailaddr', 'none' ) eq 'none' ); - return qq(usage: ${cmd} pass=) if ( scalar( @{$aArg} ) != 2 ); + return qq(usage: ${cmd} pass=) if ( scalar( @{$aArg} ) != 2 + || scalar(keys %{$hArg} != 1 ); StorePassword( $hash, $name, $hArg->{'pass'} ); return Timer_GetData($hash);