1
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-05-04 22:19:38 +00:00

Set CUL state after reconnect

git-svn-id: https://svn.fhem.de/fhem/trunk@444 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2009-09-26 09:26:09 +00:00
parent 7534da3e11
commit 5ab0ecf335

View File

@ -72,7 +72,7 @@ CUL_Initialize($)
$hash->{GetFn} = "CUL_Get"; $hash->{GetFn} = "CUL_Get";
$hash->{SetFn} = "CUL_Set"; $hash->{SetFn} = "CUL_Set";
$hash->{StateFn} = "CUL_SetState"; $hash->{StateFn} = "CUL_SetState";
$hash->{AttrList}= "do_not_notify:1,0 dummy:1,0 filtertimeout repeater:1,0 " . $hash->{AttrList}= "do_not_notify:1,0 dummy:1,0 filtertimeout " .
"showtime:1,0 model:CUL,CUR loglevel:0,1,2,3,4,5,6 " . "showtime:1,0 model:CUL,CUR loglevel:0,1,2,3,4,5,6 " .
"CUR_id_list"; "CUR_id_list";
$hash->{ShutdownFn} = "CUL_Shutdown"; $hash->{ShutdownFn} = "CUL_Shutdown";
@ -95,10 +95,8 @@ CUL_Define($$)
return "FHTID must be H1H2, with H1 and H2 hex and both smaller than 64" return "FHTID must be H1H2, with H1 and H2 hex and both smaller than 64"
if(uc($a[3]) !~ m/^[0-6][0-9A-F][0-6][0-9A-F]$/); if(uc($a[3]) !~ m/^[0-6][0-9A-F][0-6][0-9A-F]$/);
$hash->{FHTID} = uc($a[3]); $hash->{FHTID} = uc($a[3]);
$hash->{STATE} = "defined";
$attr{$name}{savefirst} = 1; $attr{$name}{savefirst} = 1;
$attr{$name}{repeater} = 1;
if($dev eq "none") { if($dev eq "none") {
Log 1, "CUL device is none, commands will be echoed only"; Log 1, "CUL device is none, commands will be echoed only";
@ -977,8 +975,10 @@ CUL_OpenDev($$)
} else { } else {
Log 3, "CUL opened $dev for $name"; Log 3, "CUL opened $dev for $name";
} }
$hash->{STATE}=""; # Allow InitDev to set the state
my $ret = CUL_DoInit($hash); my $ret = CUL_DoInit($hash);
if($ret) { if($ret) {
CUL_CloseDev($hash); CUL_CloseDev($hash);
Log 1, "Cannot init $dev, ignoring it"; Log 1, "Cannot init $dev, ignoring it";