2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-22 14:16:42 +00:00

73_GasCalculator: Bugfix: Unknown "?"-reading no longer created.

git-svn-id: https://svn.fhem.de/fhem/trunk@11695 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
sailor-fhem 2016-06-19 15:20:32 +00:00
parent a8cd69e563
commit c790f6cd4f

View File

@ -151,14 +151,22 @@ sub GasCalculator_Set($@)
return "\"set GasCalculator\" needs at least one argument";
}
my $name = shift @a;
my $GasCalcName = shift @a;
my $reading = shift @a;
my $value = join(" ", @a);
my $ReturnMessage;
if ( $reading ne "?")
{
### Create Log entries for debugging
Log3 $GasCalcName, 5, $GasCalcName. " : GasCalculator - set " . $reading . " with value: " . $value;
### Write current value
readingsSingleUpdate($hash, $reading, $value, 1);
### Create ReturnMessage
$ReturnMessage = $GasCalcName . " - Successfully set " . $reading . " with value: " . $value;
}
return($ReturnMessage);
}