From f28a194ce88e0e178f228eb13c1e0647bacdec9a Mon Sep 17 00:00:00 2001 From: CoolTux Date: Thu, 19 Oct 2017 10:54:12 +0000 Subject: [PATCH] 46_TeslaPowerwall2AC: fix get data internal timer bug git-svn-id: https://svn.fhem.de/fhem/trunk@15287 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/46_TeslaPowerwall2AC.pm | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 606a79b20..681e65835 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - bugfix: 46_TeslaPowerwall2AC: fix get data internal timer bug - bugfix: 93_Log2Syslog: typo in commandref - feature: global dnsHostsFile attribute added (Forum #78025) - feature: 98_DOIFtools: add getter hsvColorGradient, returns a table of diff --git a/fhem/FHEM/46_TeslaPowerwall2AC.pm b/fhem/FHEM/46_TeslaPowerwall2AC.pm index 7f486203d..7d034206c 100644 --- a/fhem/FHEM/46_TeslaPowerwall2AC.pm +++ b/fhem/FHEM/46_TeslaPowerwall2AC.pm @@ -66,7 +66,7 @@ use HttpUtils; eval "use JSON;1" or $missingModul .= "JSON "; -my $version = "0.2.0"; +my $version = "0.2.2"; @@ -144,7 +144,7 @@ sub TeslaPowerwall2AC_Define($$) { $attr{$name}{room} = "Tesla" if( !defined( $attr{$name}{room} ) ); - Log3 $name, 3, "TeslaPowerwall2AC ($name) - defined SmartPi Device with Host $host, Port $hash->{PORT} and Interval $hash->{INTERVAL}"; + Log3 $name, 3, "TeslaPowerwall2AC ($name) - defined TeslaPowerwall2AC Device with Host $host, Port $hash->{PORT} and Interval $hash->{INTERVAL}"; $modules{TeslaPowerwall2AC}{defptr}{HOST} = $hash; @@ -230,7 +230,8 @@ sub TeslaPowerwall2AC_Notify($$) { TeslaPowerwall2AC_Timer_GetData($hash) if( grep /^INITIALIZED$/,@{$events} - or grep /^DELETEATTR.$name.disable$/,@{$events} ); + or grep /^DELETEATTR.$name.disable$/,@{$events} + or (grep /^DEFINED.$name$/,@{$events} and $init_done) ); return; } @@ -290,7 +291,7 @@ sub TeslaPowerwall2AC_Timer_GetData($) { my $name = $hash->{NAME}; - if( $init_done and defined($hash->{actionQueue}) and scalar(@{$hash->{actionQueue}}) == 0 ) { + if( defined($hash->{actionQueue}) and scalar(@{$hash->{actionQueue}}) == 0 ) { if( not IsDisabled($name) ) { while( my $obj = each %paths ) { unshift( @{$hash->{actionQueue}}, $obj );