From aa93079c83e3e6fa424fcfe63fa84591c6384fe3 Mon Sep 17 00:00:00 2001 From: jpawlowski Date: Tue, 25 Apr 2017 06:18:38 +0000 Subject: [PATCH] THINKINGCLEANER: fix uninitialized value git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@14100 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/74_THINKINGCLEANER.pm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/FHEM/74_THINKINGCLEANER.pm b/FHEM/74_THINKINGCLEANER.pm index 0fe8707f5..bdedfc01b 100644 --- a/FHEM/74_THINKINGCLEANER.pm +++ b/FHEM/74_THINKINGCLEANER.pm @@ -132,6 +132,8 @@ sub THINKINGCLEANER_Undefine($$$) { return undef; } +sub THINKINGCLEANER_Set($$$); + sub THINKINGCLEANER_Set($$$) { my ( $hash, $a, $h ) = @_; my $name = $hash->{NAME}; @@ -1317,6 +1319,7 @@ sub THINKINGCLEANER_ReceiveCommand($$$) { $rPrefix = "sensor" if ( $r eq "sensors" ); foreach my $r2 ( keys %{ $return->{$r} } ) { + next unless ( $r2 && $r2 ne "" ); # INTERNALS or dynamic values if ( $r2 eq "cleaning" ) { @@ -1517,9 +1520,8 @@ sub THINKINGCLEANER_ReceiveCommand($$$) { $readingName =~ s/_(state|button|current)$//; $readingName =~ s/[-_](\w)/\U\1/g; - readingsBulkUpdate( $hash, $readingName, $v ) - if ( - ReadingsVal( $name, $readingName, "" ) ne $v ); + readingsBulkUpdateIfChanged( $hash, $readingName, + $v ); } } }