2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 23:06:37 +00:00

THZ: short delay added for willy

git-svn-id: https://svn.fhem.de/fhem/trunk@6019 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
immiimmi 2014-05-31 09:12:52 +00:00
parent b3ce1d6e89
commit e25fdf433a

View File

@ -2,8 +2,7 @@
# 00_THZ
# $Id$
# by immi 05/2014
# v. 0.103
my $thzversion = "0.103";
my $thzversion = "0.104";
# this code is based on the hard work of Robert; I just tried to port it
# http://robert.penz.name/heat-pump-lwz/
# http://heatpumpmonitor.penz.name/heatpumpmonitorwiki/
@ -649,7 +648,7 @@ my ($err, $msg) =("", " ");
if($msg eq "1002" || $msg eq "02") {
THZ_Write($hash, "10"); # DLE data link escape // ack datatranfer
select(undef,undef,undef,0.001); #needed to fix hystory parameter
select(undef,undef,undef,0.01); #needed to fix hystory parameter
($err, $msg) = THZ_ReadAnswer($hash); # Expectedanswer3 // read from the heatpump
THZ_Write($hash, "10");
}
@ -672,7 +671,10 @@ sub THZ_ReadAnswer($)
{
my ($hash) = @_;
Log3 $hash->{NAME}, 5, "$hash->{NAME} start Funktion THZ_ReadAnswer";
select(undef,undef,undef,0.001);
my $buf = DevIo_SimpleReadWithTimeout($hash, 1);
#$buf1 = DevIo_SimpleReadWithTimeout($hash, 0.001);
#$buf = ($buf . $buf1) if(defined($buf1));
if(!defined($buf)) {
Log3 $hash->{NAME}, 3, "$hash->{NAME} THZ_ReadAnswer got no answer from DevIo_SimpleRead. Maybe timeout to slow?";
return ("InterfaceNotRespondig", "");