2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00
git-svn-id: https://svn.fhem.de/fhem/trunk@38 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2007-03-29 09:09:36 +00:00
parent f5b40c6e4c
commit 3d0e9bc96b
3 changed files with 11 additions and 9 deletions

View File

@ -211,8 +211,10 @@ FHZ_Define($$)
return undef;
}
Log 3, "FHZ opening FHZ device $dev";
my $po = new Device::SerialPort ($dev);
return "Can't open $dev: $!\n" if(!$po);
Log 3, "FHZ opened FHZ device $dev";
$po->reset_error();
$po->baudrate(9600);

View File

@ -110,7 +110,7 @@ FS20_SetState($$$$)
{
my ($hash, $tim, $vt, $val) = @_;
$val = $1 if($val =~ m/^\(.*\) \d+$/);
$val = $1 if($val =~ m/^(.*) \d+$/);
return "Undefined value $val" if(!defined($fs20_c2b{$val}));
return undef;
}

View File

@ -1303,8 +1303,8 @@ CommandSetstate($$)
if($a[1] =~ m/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} /) {
my @b = split(" ", $a[1], 4);
if(@b == 3) { # Compatibility mode
$b[3] = $b[2];
if($defs{$a[0]}{TYPE} eq "FS20" && $b[2] ne "state") { # Compatibility mode
$b[3] = $b[2] . ($b[3] ? " $b[3]" : "");
$b[2] = "state";
}
@ -1312,13 +1312,13 @@ CommandSetstate($$)
$ret = CallFn($a[0], "StateFn", $d, $tim, $b[2], $b[3]);
return $ret if($ret);
next if($d->{READINGS}{$b[2]} && $d->{READINGS}{$b[2]}{TIME} ge $tim);
if(!$d->{READINGS}{$b[2]} || $d->{READINGS}{$b[2]}{TIME} lt $tim) {
$d->{READINGS}{$b[2]}{VAL} = $b[3];
$d->{READINGS}{$b[2]}{TIME} = $tim;
$d->{READINGS}{$b[2]}{VAL} = $b[3];
$d->{READINGS}{$b[2]}{TIME} = $tim;
$oldvalue{$a[0]}{TIME} = $tim;
$oldvalue{$a[0]}{VAL} = $b[2];
$oldvalue{$a[0]}{TIME} = $tim;
$oldvalue{$a[0]}{VAL} = $b[2];
}
} else {
$d->{STATE} = $a[1];