fix bug Can't use string as a HASH ref
error with newest firmware Can't use string ("updating synchrometer") as a HASH ref while "strict refs" [Ticket: no]
This commit is contained in:
parent
d9a7ac4853
commit
d604ef1baf
@ -1,2 +1,2 @@
|
|||||||
UPD 2022-01-29_04:24:06 6874 FHEM/46_TeslaPowerwall2AC.pm
|
UPD 2022-01-29_04:24:06 6874 FHEM/46_TeslaPowerwall2AC.pm
|
||||||
UPD 2022-02-19_20:54:38 28171 lib/FHEM/Devices/Tesla/Powerwall.pm
|
UPD 2022-02-28_14:49:01 28406 lib/FHEM/Devices/Tesla/Powerwall.pm
|
||||||
|
@ -521,7 +521,7 @@ sub ErrorHandling {
|
|||||||
}
|
}
|
||||||
|
|
||||||
## Fehler für neuen Token
|
## Fehler für neuen Token
|
||||||
## {"code":401,"error":"User session not found from HEZwKy9lY17-gLagEdpyzk3IsJgUvrE1jTP_SBDTyDQ2PPU--A8kF_p2tRmBQRLVKYzR11ijhO0j6kOXFzmxcw==","message":"Invalid bearer token"}
|
## {"code":401,"error":"User session not found from HEZwKy9lY17-gLagEdpyzk3IsJgUvrE1XFzmxcw==","message":"Invalid bearer token"}
|
||||||
|
|
||||||
if ( $data =~ m#{"code":(\d+),"error":"(.+)","message":"(.+)"}\z#xms ) {
|
if ( $data =~ m#{"code":(\d+),"error":"(.+)","message":"(.+)"}\z#xms ) {
|
||||||
|
|
||||||
@ -712,35 +712,39 @@ sub ReadingsProcessing_Powerwalls {
|
|||||||
my $r1 = $_;
|
my $r1 = $_;
|
||||||
my $hRef;
|
my $hRef;
|
||||||
for my $hRef ( @{ $decode_json->{$_} } ) {
|
for my $hRef ( @{ $decode_json->{$_} } ) {
|
||||||
for ( keys %{$hRef} ) {
|
if ( ref($hRef) eq 'HASH' ) {
|
||||||
$r1 =~ s/s$//xg;
|
for ( keys %{$hRef} ) {
|
||||||
$readings{qq(${r1}_${i}_${_})} = $hRef->{$_}
|
$r1 =~ s/s$//xg;
|
||||||
if ( ref( $hRef->{$_} ) ne 'ARRAY'
|
$readings{qq(${r1}_${i}_${_})} = $hRef->{$_}
|
||||||
&& ref( $hRef->{$_} ) ne 'HASH'
|
if ( ref( $hRef->{$_} ) ne 'ARRAY'
|
||||||
&& defined( $hRef->{$_} ) );
|
&& ref( $hRef->{$_} ) ne 'HASH'
|
||||||
|
&& defined( $hRef->{$_} ) );
|
||||||
|
|
||||||
if ( ref( $hRef->{$_} ) eq 'HASH' ) {
|
if ( ref( $hRef->{$_} ) eq 'HASH' ) {
|
||||||
my $r2 = $_;
|
my $r2 = $_;
|
||||||
my $r3 = $hRef->{$_};
|
my $r3 = $hRef->{$_};
|
||||||
for ( keys %{$r3} ) {
|
for ( keys %{$r3} ) {
|
||||||
$readings{qq(${r1}_${i}_${r2}_${_})} = $r3->{$_}
|
$readings{qq(${r1}_${i}_${r2}_${_})} =
|
||||||
if ( ref( $r3->{$_} ) ne 'ARRAY'
|
$r3->{$_}
|
||||||
&& defined( $r3->{$_} ) );
|
if ( ref( $r3->{$_} ) ne 'ARRAY'
|
||||||
|
&& defined( $r3->{$_} ) );
|
||||||
|
|
||||||
if ( ref( $r3->{$_} ) eq 'ARRAY' ) {
|
if ( ref( $r3->{$_} ) eq 'ARRAY' ) {
|
||||||
my $ii = 0;
|
my $ii = 0;
|
||||||
my $r4 = $_;
|
my $r4 = $_;
|
||||||
for $hRef ( @{ $r3->{$_} } ) {
|
for $hRef ( @{ $r3->{$_} } ) {
|
||||||
for ( keys %{$hRef} ) {
|
for ( keys %{$hRef} ) {
|
||||||
$r4 =~ s/s$//xg;
|
$r4 =~ s/s$//xg;
|
||||||
$readings{
|
$readings{
|
||||||
qq(${r1}_${i}_${r2}_${r4}_${ii}_${_})
|
qq(${r1}_${i}_${r2}_${r4}_${ii}_${_})
|
||||||
} = $hRef->{$_}
|
} = $hRef->{$_}
|
||||||
if ( ref( $hRef->{$_} ) ne 'HASH'
|
if (
|
||||||
&& defined( $hRef->{$_} ) );
|
ref( $hRef->{$_} ) ne 'HASH'
|
||||||
}
|
&& defined( $hRef->{$_} ) );
|
||||||
|
}
|
||||||
|
|
||||||
$ii++;
|
$ii++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user