remove hash ref check

This commit is contained in:
Marko Oldenburg 2021-03-05 10:18:08 +01:00
parent eea01cc5b8
commit a294b26768
2 changed files with 15 additions and 15 deletions

View File

@ -726,19 +726,19 @@ sub ReadingsProcessing_Powerwalls {
$readings{ 'wall_' . $i . '_' . $r } = $v $readings{ 'wall_' . $i . '_' . $r } = $v
if ( ref($v) ne 'HASH' ); if ( ref($v) ne 'HASH' );
if ( ref($v) eq 'HASH' ) { # if ( ref($v) eq 'HASH' ) {
while ( my ( $s, $ts ) = each %{$v} ) { # while ( my ( $s, $ts ) = each %{$v} ) {
if ( ref( $ts ) eq 'ARRAY' # if ( ref( $ts ) eq 'ARRAY'
&& scalar( @{ $ts } ) > 0 ) # && scalar( @{ $ts } ) > 0 )
{ # {
my $j = 0; # my $j = 0;
for my $t ( @{ $ts } ) { # for my $t ( @{ $ts } ) {
$readings{ 'wall_' . $i . '_' . $r . '_' . $s . '_' . $j } = $t; # $readings{ 'wall_' . $i . '_' . $r . '_' . $s . '_' . $j } = $t;
$j++; # $j++;
} # }
} # }
} # }
} # }
} }
$i++; $i++;
@ -1096,7 +1096,7 @@ sub Rename {
], ],
"release_status": "stable", "release_status": "stable",
"license": "GPL_2", "license": "GPL_2",
"version": "v1.0.4", "version": "v1.0.5",
"author": [ "author": [
"Marko Oldenburg <leongaultier@gmail.com>" "Marko Oldenburg <leongaultier@gmail.com>"
], ],

View File

@ -1 +1 @@
UPD 2021-03-02_18:52:33 31370 FHEM/46_TeslaPowerwall2AC.pm UPD 2021-03-05_10:17:54 31396 FHEM/46_TeslaPowerwall2AC.pm