mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 13:26:02 +00:00
Zwave: fix from Mx112
git-svn-id: https://svn.fhem.de/fhem/trunk@4269 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
1e41ad350a
commit
0a13c7182d
@ -438,13 +438,13 @@ ZWave_ParseMeter($)
|
||||
my $prec = $prectab[($v2 >> 5) & 0x7];
|
||||
my $scale = ($v2 >> 3) & 0x3;
|
||||
my $size = ($v2 >> 0) & 0x7;
|
||||
my @txt = ("undef", "power", "gas", "water");
|
||||
my @txt = ("undef", "energy", "gas", "water");
|
||||
my $txt = ($v1 > $#txt ? "undef" : $txt[$v1]);
|
||||
my %unit = (energy => ["kWh", "kVAh", "W", "pulseCount"],
|
||||
gas => ["m3", "feet3", "undef", "pulseCount"],
|
||||
water => ["m3", "feet3", "USgallons", "pulseCount"]);
|
||||
my $unit = $txt eq "undef" ? "undef" : $unit{$txt}[$scale];
|
||||
$txt = "power" if ($unit == "W");
|
||||
$txt = "power" if ($unit eq "W");
|
||||
$v3 = hex(substr($v3, 0, 2*$size))/$prec;
|
||||
return "$txt:$v3 $unit";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user