percentage Reading fix comma character

This commit is contained in:
Marko Oldenburg 2017-10-14 16:55:41 +02:00
parent 56a1f3700e
commit c45a6958f8

View File

@ -66,7 +66,7 @@ use HttpUtils;
eval "use JSON;1" or $missingModul .= "JSON ";
my $version = "0.0.18";
my $version = "0.0.21";
@ -232,6 +232,10 @@ sub TeslaPowerwall2AC_Get($@) {
$arg = lc($cmd);
} elsif( $cmd eq 'sitemaster' ) {
$arg = lc($cmd);
} else {
my $list = 'statusSOE:noArg aggregates:noArg siteinfo:noArg sitemaster:noArg powerwalls:noArg';
@ -419,7 +423,8 @@ sub TeslaPowerwall2AC_WriteReadings($$$) {
readingsBeginUpdate($hash);
while( my ($r,$v) = each %{$readings} ) {
readingsBulkUpdateIfChanged($hash,$path.'-'.$r,$v);
readingsBulkUpdate($hash,$path.'-'.$r,$v);
readingsBulkUpdate($hash,$path.'-'.$r,sprintf("%.1f",$v) if($r eq 'percentage');
}
readingsBulkUpdateIfChanged($hash,'state','ready');