mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-19 18:56:03 +00:00
70_SolarEdgeAPI: tolerate empty field in energyDetails response
git-svn-id: https://svn.fhem.de/fhem/trunk@20896 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
1c258e6aeb
commit
7400af8fcd
@ -152,12 +152,14 @@ eval "use JSON;1" or $solarEdgeAPI_missingModul .= "JSON ";
|
|||||||
# - "disabled" if the device is disabled
|
# - "disabled" if the device is disabled
|
||||||
# - "active" otherwise
|
# - "active" otherwise
|
||||||
#
|
#
|
||||||
|
# 2.0.1 tolerate empty field in energyDetails response
|
||||||
|
#
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
sub SolarEdgeAPI_SetVersion($)
|
sub SolarEdgeAPI_SetVersion($)
|
||||||
{
|
{
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
$hash->{VERSION} = "2.0.0";
|
$hash->{VERSION} = "2.0.1";
|
||||||
}
|
}
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
@ -969,9 +971,12 @@ sub SolarEdgeAPI_ReadingsProcessing_Aggregates($$)
|
|||||||
foreach my $meterData (@{$meter -> {'values'}})
|
foreach my $meterData (@{$meter -> {'values'}})
|
||||||
{
|
{
|
||||||
my $value = $meterData->{'value'};
|
my $value = $meterData->{'value'};
|
||||||
|
if (defined $value)
|
||||||
|
{
|
||||||
$meterCum = $meterCum + $value;
|
$meterCum = $meterCum + $value;
|
||||||
$meterRecent15Min = $value;
|
$meterRecent15Min = $value;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
$readings{$meterType . "-cumToday"} = $meterCum;
|
$readings{$meterType . "-cumToday"} = $meterCum;
|
||||||
$readings{$meterType . "-recent15min"} = $meterRecent15Min;
|
$readings{$meterType . "-recent15min"} = $meterRecent15Min;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user