mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-21 07:56:03 +00:00
98_Siro.pm:Fix Bugfix fhemrestart state, position
git-svn-id: https://svn.fhem.de/fhem/trunk@15956 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
8899d15c9f
commit
38378095a3
@ -304,6 +304,7 @@ sub Siro_LoadHelper($)
|
|||||||
my $save = ReadingsVal($name, '.aktMsg', 'undef');
|
my $save = ReadingsVal($name, '.aktMsg', 'undef');
|
||||||
if ($save eq 'undef')
|
if ($save eq 'undef')
|
||||||
{
|
{
|
||||||
|
Log3($name, 5, "Siro: Helper lade new device");
|
||||||
$hash->{helper}{position}="0";
|
$hash->{helper}{position}="0";
|
||||||
$hash->{helper}{aktMsg} = "stop".' '.'0'.' '.gettimeofday();
|
$hash->{helper}{aktMsg} = "stop".' '.'0'.' '.gettimeofday();
|
||||||
$hash->{helper}{lastMsg} = "stop".' '.'0'.' '.gettimeofday();
|
$hash->{helper}{lastMsg} = "stop".' '.'0'.' '.gettimeofday();
|
||||||
@ -315,6 +316,7 @@ sub Siro_LoadHelper($)
|
|||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Log3($name, 5, "Siro: Helper lade bestandsdaten");
|
||||||
$hash->{helper}{aktMsg} = ReadingsVal($name, '.aktMsg', '');
|
$hash->{helper}{aktMsg} = ReadingsVal($name, '.aktMsg', '');
|
||||||
$hash->{helper}{lastMsg} = ReadingsVal($name, '.lastMsg', '');
|
$hash->{helper}{lastMsg} = ReadingsVal($name, '.lastMsg', '');
|
||||||
$hash->{helper}{lastparse} = ReadingsVal($name, '.lastparse', '');
|
$hash->{helper}{lastparse} = ReadingsVal($name, '.lastparse', '');
|
||||||
@ -323,8 +325,12 @@ sub Siro_LoadHelper($)
|
|||||||
$hash->{helper}{parse_aborted} = ReadingsVal($name, '.parse_aborted', '');
|
$hash->{helper}{parse_aborted} = ReadingsVal($name, '.parse_aborted', '');
|
||||||
$hash->{helper}{position} = ReadingsVal($name, '.positionsave', '');
|
$hash->{helper}{position} = ReadingsVal($name, '.positionsave', '');
|
||||||
$hash->{helper}{positiontimer} = ReadingsVal($name, '.positiontimer', '');
|
$hash->{helper}{positiontimer} = ReadingsVal($name, '.positiontimer', '');
|
||||||
|
readingsSingleUpdate($hash, "position",ReadingsVal($name, '.positionsave', '0'), 0);
|
||||||
|
readingsSingleUpdate($hash, "state",ReadingsVal($name, '.positionsave', '0'), 0);
|
||||||
}
|
}
|
||||||
Log3($name, 5, "Siro: Helper initialisiert");
|
Log3($name, 5, "Siro: Helper initialisiert: positionsave ".ReadingsVal($name, '.positionsave', '0')." ");
|
||||||
|
Log3($name, 5, "Siro: Helper initialisiert: state ".ReadingsVal($name, 'state', '0')." ");
|
||||||
|
Log3($name, 5, "Siro: Helper initialisiert: position ".ReadingsVal($name, 'position', '0')." ");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -410,7 +416,7 @@ sub Siro_SendCommand($@)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$binChannel = sprintf("%04b",$chan);
|
$binChannel = sprintf("%04b",$chan);
|
||||||
Log3($name, 5, "Siro set channel: $chan ($binChannel) for $io->{NAME}");
|
#Log3($name, 5, "Siro set channel: $chan ($binChannel) for $io->{NAME}");
|
||||||
|
|
||||||
my $value = $name ." ". join(" ", @args);
|
my $value = $name ." ". join(" ", @args);
|
||||||
|
|
||||||
@ -439,7 +445,7 @@ sub Siro_SendCommand($@)
|
|||||||
my $devicename =$hash->{IODev};
|
my $devicename =$hash->{IODev};
|
||||||
|
|
||||||
Log3($name, 5, "Siro_sendCommand: name -> $name command -> $cmd ");
|
Log3($name, 5, "Siro_sendCommand: name -> $name command -> $cmd ");
|
||||||
Log3($name, 3, "Siro_sendCommand: execute comand $cmd - sendMsg to $devicename channel $chan -> $message ");
|
#Log3($name, 3, "Siro_sendCommand: execute comand $cmd - sendMsg to $devicename channel $chan -> $message ");
|
||||||
|
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
@ -743,7 +749,13 @@ sub Siro_Attr(@)
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $oldstate =$hash->{helper}{position};
|
my $oldstate =$hash->{helper}{position};
|
||||||
|
|
||||||
|
#Log3 $hash, 0, "Siro_Attr: ";
|
||||||
if(!defined $oldstate){$oldstate=0};
|
if(!defined $oldstate){$oldstate=0};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
my $newState = $oldstate;
|
my $newState = $oldstate;
|
||||||
my $updateState;
|
my $updateState;
|
||||||
Log3 $hash, 3, "Siro_Attr: state old -> $oldstate new -> $newState";
|
Log3 $hash, 3, "Siro_Attr: state old -> $oldstate new -> $newState";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user