2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-16 04:36:02 +00:00

Correction & change by Klaus Bueker.

git-svn-id: https://svn.fhem.de/fhem/trunk@410 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2009-07-06 12:43:34 +00:00
parent 213c349f07
commit bb106c95a5

View File

@ -144,25 +144,22 @@ HMS_Parse($$)
@txt = ( "water_detect", "battery");
@sfx = ( "", "");
# Battery-low condition detect is not yet properly
# implemented. As soon as my WD's batteries get low
# I am willing to supply a patch ;-) SEP7-RIPE, 2006/05/13
my $status = hex(substr($msg, 10, 1)); #Battery low condition
$v[1] = (($status & 4) ? "empty" : "ok"); # bit is set if Voltage < 2.5 V.
my $status = hex(substr($val, 1, 1));
$v[0] = "off";
if ( $status & 1 ) { $v[0] = "on"; }
$val = "Water Detect: $v[0]";
$status = hex(substr($msg, 10, 1)); #Battery low condition
$v[1] = (($status & 4) ? "empty" : "ok"); # bit is set if Voltage < 2.5 V.
} elsif ($type eq "HMS100TFK") { # By Peter P.
@txt = ( "switch_detect", "battery");
@sfx = ( "", "");
# Battery-low condition detect is not yet properly implemented.
my $status = hex(substr($val, 1, 1));
$v[0] = ($status ? "on" : "off");
$v[1] = "off";
$val = "Switch Detect: $v[0]";
$status = hex(substr($msg, 10, 1)); #Battery low condition
$v[1] = (($status & 4) ? "empty" : "ok"); # bit is set if Voltage < 2.5 V.
} elsif($type eq "RM100-2") {