mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
24_TPLinkHS110.pm: Fixed bug getting realtime data
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@17468 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
361a289e3e
commit
e83e4d351f
@ -155,7 +155,6 @@ sub TPLinkHS110_Get($$)
|
|||||||
Timeout => $hash->{TIMEOUT} )
|
Timeout => $hash->{TIMEOUT} )
|
||||||
or return "Couldn't connect to $remote_host:$remote_port: $@\n";
|
or return "Couldn't connect to $remote_host:$remote_port: $@\n";
|
||||||
$socket->write($rc);
|
$socket->write($rc);
|
||||||
$socket->write($c);
|
|
||||||
IO::Socket::Timeout->enable_timeouts_on($socket);
|
IO::Socket::Timeout->enable_timeouts_on($socket);
|
||||||
$socket->read_timeout(.5);
|
$socket->read_timeout(.5);
|
||||||
my $rdata;
|
my $rdata;
|
||||||
@ -172,7 +171,7 @@ sub TPLinkHS110_Get($$)
|
|||||||
readingsEndUpdate($hash, 1);
|
readingsEndUpdate($hash, 1);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
Log3 $hash, 1, "TPLinkHS110: $name Realtime data updated";
|
Log3 $hash, 2, "TPLinkHS110: $name Realtime data updated";
|
||||||
}
|
}
|
||||||
|
|
||||||
my %emeterReadings = ();
|
my %emeterReadings = ();
|
||||||
@ -239,7 +238,7 @@ sub TPLinkHS110_Get($$)
|
|||||||
$count = @{$json->{'emeter'}->{'get_daystat'}->{'day_list'}};
|
$count = @{$json->{'emeter'}->{'get_daystat'}->{'day_list'}};
|
||||||
readingsBulkUpdate($hash, "monthly_total", $total);
|
readingsBulkUpdate($hash, "monthly_total", $total);
|
||||||
if ($count) { readingsBulkUpdate($hash, "daily_average", $total/$count)};
|
if ($count) { readingsBulkUpdate($hash, "daily_average", $total/$count)};
|
||||||
Log3 $hash, 1, "TPLinkHS110: $name Daystat updated";
|
Log3 $hash, 2, "TPLinkHS110: $name Daystat updated";
|
||||||
} else {
|
} else {
|
||||||
Log3 $hash, 1, "TPLinkHS110: $name Error updating daystat. Success: " . $success . ", json: " . $json;
|
Log3 $hash, 1, "TPLinkHS110: $name Error updating daystat. Success: " . $success . ", json: " . $json;
|
||||||
Log3 $hash, 3, "TPLinkHS110: $name Updating readings";
|
Log3 $hash, 3, "TPLinkHS110: $name Updating readings";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user