mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
Bugfixes
git-svn-id: https://svn.fhem.de/fhem/trunk@38 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
f5b40c6e4c
commit
3d0e9bc96b
@ -211,8 +211,10 @@ FHZ_Define($$)
|
|||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Log 3, "FHZ opening FHZ device $dev";
|
||||||
my $po = new Device::SerialPort ($dev);
|
my $po = new Device::SerialPort ($dev);
|
||||||
return "Can't open $dev: $!\n" if(!$po);
|
return "Can't open $dev: $!\n" if(!$po);
|
||||||
|
Log 3, "FHZ opened FHZ device $dev";
|
||||||
|
|
||||||
$po->reset_error();
|
$po->reset_error();
|
||||||
$po->baudrate(9600);
|
$po->baudrate(9600);
|
||||||
|
@ -110,7 +110,7 @@ FS20_SetState($$$$)
|
|||||||
{
|
{
|
||||||
my ($hash, $tim, $vt, $val) = @_;
|
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 "Undefined value $val" if(!defined($fs20_c2b{$val}));
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
|
16
fhem/fhem.pl
16
fhem/fhem.pl
@ -1303,8 +1303,8 @@ CommandSetstate($$)
|
|||||||
if($a[1] =~ m/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} /) {
|
if($a[1] =~ m/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2} /) {
|
||||||
my @b = split(" ", $a[1], 4);
|
my @b = split(" ", $a[1], 4);
|
||||||
|
|
||||||
if(@b == 3) { # Compatibility mode
|
if($defs{$a[0]}{TYPE} eq "FS20" && $b[2] ne "state") { # Compatibility mode
|
||||||
$b[3] = $b[2];
|
$b[3] = $b[2] . ($b[3] ? " $b[3]" : "");
|
||||||
$b[2] = "state";
|
$b[2] = "state";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1312,13 +1312,13 @@ CommandSetstate($$)
|
|||||||
$ret = CallFn($a[0], "StateFn", $d, $tim, $b[2], $b[3]);
|
$ret = CallFn($a[0], "StateFn", $d, $tim, $b[2], $b[3]);
|
||||||
return $ret if($ret);
|
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];
|
$oldvalue{$a[0]}{TIME} = $tim;
|
||||||
$d->{READINGS}{$b[2]}{TIME} = $tim;
|
$oldvalue{$a[0]}{VAL} = $b[2];
|
||||||
|
}
|
||||||
$oldvalue{$a[0]}{TIME} = $tim;
|
|
||||||
$oldvalue{$a[0]}{VAL} = $b[2];
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$d->{STATE} = $a[1];
|
$d->{STATE} = $a[1];
|
||||||
|
Loading…
Reference in New Issue
Block a user