mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
36_Level.pm: added sensor type 1 (for hydrostatic)
git-svn-id: https://svn.fhem.de/fhem/trunk@19749 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
1beac8f4eb
commit
3e0d228b79
@ -152,13 +152,21 @@ Level_Parse($$)
|
||||
push(@list, $rname);
|
||||
|
||||
$rhash->{Level_lastRcv} = TimeNow();
|
||||
$rhash->{SensorType} = $type;
|
||||
|
||||
readingsBeginUpdate($rhash);
|
||||
|
||||
my $litresPerCm = AttrVal( $rname, "litersPerCm", 1);
|
||||
my $distanceToBottom = AttrVal( $rname, "distanceToBottom", 100);
|
||||
|
||||
my $level = $distanceToBottom - $distance;
|
||||
my $level = -273;
|
||||
if($type eq 1) {
|
||||
$level = $distance;
|
||||
}
|
||||
else {
|
||||
$level = $distanceToBottom - $distance;
|
||||
}
|
||||
|
||||
|
||||
my $litres = 0;
|
||||
my $formula = AttrVal( $rname, "formula", undef);
|
||||
@ -178,7 +186,9 @@ Level_Parse($$)
|
||||
|
||||
$litres = int($litres);
|
||||
|
||||
readingsBulkUpdate($rhash, "distance", $distance);
|
||||
if($type ne 1) {
|
||||
readingsBulkUpdate($rhash, "distance", $distance);
|
||||
}
|
||||
readingsBulkUpdate($rhash, "level", $level);
|
||||
readingsBulkUpdate($rhash, "liters", $litres);
|
||||
readingsBulkUpdate($rhash, "temperature", $temperature);
|
||||
|
Loading…
Reference in New Issue
Block a user