24_TPLinkHS110: Fixed division by zero error

git-svn-id: https://svn.fhem.de/fhem/trunk@12727 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
vsauer
2016-12-08 15:27:01 +00:00
parent e54aecea18
commit 32e50ef423

View File

@@ -165,7 +165,7 @@ sub TPLinkHS110_Get($$)
my $count=1;
$count = @{$json->{'emeter'}->{'get_daystat'}->{'day_list'}};
readingsBulkUpdate($hash, "monthly_total", $total);
readingsBulkUpdate($hash, "daily_average", $total/$count);
if ($count) { readingsBulkUpdate($hash, "daily_average", $total/$count)};
1;
} or do {
Log3 $hash, 3, "TPLinkHS110: $name json-decoding failed. Problem decoding getting statistical data";