update power reading after switch off

git-svn-id: https://svn.fhem.de/fhem/trunk@4369 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme1968
2013-12-12 18:16:40 +00:00
parent 77bbd3293d
commit 177d0cf870

View File

@@ -233,7 +233,7 @@ PCA301_Parse($$)
my $consumption = ($bytes[8]*256 + $bytes[9]) / 100.0;
my $state = $state; $state = $power if( $readonly );
readingsBeginUpdate($rhash);
readingsBulkUpdate($rhash, "power", $power) if( $data != 0x00 );
readingsBulkUpdate($rhash, "power", $power) if( $data != 0x00 || ReadingsVal($rname,"power",0) );
readingsBulkUpdate($rhash, "consumption", $consumption) if( $data != 0x00 );
readingsBulkUpdate($rhash, "state", $state) if( Value($rname) ne $state );
readingsEndUpdate($rhash,1);