update readings on change even if switched off

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@4439 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2013-12-22 12:09:51 +00:00
parent 3961ef56c3
commit ac3deed3f4

View File

@ -233,9 +233,9 @@ 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 || ReadingsVal($rname,"power",0) );
readingsBulkUpdate($rhash, "consumption", $consumption) if( $data != 0x00 );
readingsBulkUpdate($rhash, "state", $state) if( Value($rname) ne $state );
readingsBulkUpdate($rhash, "power", $power) if( $power != ReadingsVal($rname,"power",0) );
readingsBulkUpdate($rhash, "consumption", $consumption) if( $consumption != ReadingsVal($rname,"consumption",0) );
readingsBulkUpdate($rhash, "state", $state) if( $state ne ReadingsVal($rname,"state","") );
readingsEndUpdate($rhash,1);
} elsif( $cmd eq 0x05 ) {
$state = $data==0x00?"off":"on";