mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-13 17:26:34 +00:00
82_LGTV_WebOS: 1.2.0 bugfix - hack for properly fhem freez after set off
git-svn-id: https://svn.fhem.de/fhem/trunk@15307 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
615680cec1
commit
ee90b4b562
@ -1,5 +1,7 @@
|
|||||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||||
# Do not insert empty lines here, update check depends on it.
|
# Do not insert empty lines here, update check depends on it.
|
||||||
|
- bugfix: 82_LGTV_WebOS: 1.2.0 bugfix - hack for properly fhem freez after
|
||||||
|
tvswitch off and more
|
||||||
- change: 93_DbLog: V2.22.13, output of reopen command improved
|
- change: 93_DbLog: V2.22.13, output of reopen command improved
|
||||||
- bugfix: 93_DbLog: V2.22.12, avoid illegible messages in "state"
|
- bugfix: 93_DbLog: V2.22.12, avoid illegible messages in "state"
|
||||||
- feature: 59_WUup: add set-command "update"
|
- feature: 59_WUup: add set-command "update"
|
||||||
|
@ -67,7 +67,7 @@ use Blocking;
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
my $version = "1.0.1";
|
my $version = "1.2.0";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -258,7 +258,7 @@ sub LGTV_WebOS_Define($$) {
|
|||||||
if( $init_done ) {
|
if( $init_done ) {
|
||||||
LGTV_WebOS_TimerStatusRequest($hash);
|
LGTV_WebOS_TimerStatusRequest($hash);
|
||||||
} else {
|
} else {
|
||||||
InternalTimer( gettimeofday()+15, "LGTV_WebOS_TimerStatusRequest", $hash, 0 );
|
InternalTimer( gettimeofday()+15, "LGTV_WebOS_TimerStatusRequest", $hash );
|
||||||
}
|
}
|
||||||
|
|
||||||
return undef;
|
return undef;
|
||||||
@ -332,8 +332,6 @@ sub LGTV_WebOS_TimerStatusRequest($) {
|
|||||||
|
|
||||||
Log3 $name, 4, "LGTV_WebOS ($name) - run get functions";
|
Log3 $name, 4, "LGTV_WebOS ($name) - run get functions";
|
||||||
|
|
||||||
|
|
||||||
readingsBulkUpdate($hash, 'state', 'on');
|
|
||||||
LGTV_WebOS_Presence($hash) if( AttrVal($name,'pingPresence', 0) == 1 );
|
LGTV_WebOS_Presence($hash) if( AttrVal($name,'pingPresence', 0) == 1 );
|
||||||
|
|
||||||
if($hash->{helper}{device}{channelguide}{counter} > 2 and AttrVal($name,'channelGuide', 0) == 1 and ReadingsVal($name,'launchApp', 'TV') eq 'TV' ) {
|
if($hash->{helper}{device}{channelguide}{counter} > 2 and AttrVal($name,'channelGuide', 0) == 1 and ReadingsVal($name,'launchApp', 'TV') eq 'TV' ) {
|
||||||
@ -344,15 +342,16 @@ sub LGTV_WebOS_TimerStatusRequest($) {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
LGTV_WebOS_GetAudioStatus($hash);
|
LGTV_WebOS_GetAudioStatus($hash);
|
||||||
InternalTimer( gettimeofday()+2, 'LGTV_WebOS_GetCurrentChannel', $hash, 0 ) if( ReadingsVal($name,'launchApp', 'TV') eq 'TV' );
|
InternalTimer( gettimeofday()+2, 'LGTV_WebOS_GetCurrentChannel', $hash ) if( ReadingsVal($name,'launchApp', 'TV') eq 'TV' );
|
||||||
InternalTimer( gettimeofday()+4, 'LGTV_WebOS_GetForgroundAppInfo', $hash, 0 );
|
InternalTimer( gettimeofday()+4, 'LGTV_WebOS_GetForgroundAppInfo', $hash );
|
||||||
InternalTimer( gettimeofday()+6, 'LGTV_WebOS_Get3DStatus', $hash, 0 );
|
InternalTimer( gettimeofday()+6, 'LGTV_WebOS_Get3DStatus', $hash );
|
||||||
InternalTimer( gettimeofday()+8, 'LGTV_WebOS_GetExternalInputList', $hash, 0 );
|
InternalTimer( gettimeofday()+8, 'LGTV_WebOS_GetExternalInputList', $hash );
|
||||||
}
|
}
|
||||||
|
|
||||||
} elsif( IsDisabled($name) ) {
|
} elsif( IsDisabled($name) ) {
|
||||||
|
|
||||||
LGTV_WebOS_Close($hash);
|
LGTV_WebOS_Close($hash);
|
||||||
|
LGTV_WebOS_Presence($hash) if( AttrVal($name,'pingPresence', 0) == 1 );
|
||||||
$hash->{helper}{device}{runsetcmd} = 0;
|
$hash->{helper}{device}{runsetcmd} = 0;
|
||||||
readingsBulkUpdate($hash, 'state', 'disabled');
|
readingsBulkUpdate($hash, 'state', 'disabled');
|
||||||
|
|
||||||
@ -360,8 +359,6 @@ sub LGTV_WebOS_TimerStatusRequest($) {
|
|||||||
|
|
||||||
LGTV_WebOS_Presence($hash) if( AttrVal($name,'pingPresence', 0) == 1 );
|
LGTV_WebOS_Presence($hash) if( AttrVal($name,'pingPresence', 0) == 1 );
|
||||||
|
|
||||||
readingsBulkUpdate($hash, 'state', 'off');
|
|
||||||
|
|
||||||
readingsBulkUpdate($hash,'channel','-');
|
readingsBulkUpdate($hash,'channel','-');
|
||||||
readingsBulkUpdate($hash,'channelName','-');
|
readingsBulkUpdate($hash,'channelName','-');
|
||||||
readingsBulkUpdate($hash,'channelMedia','-');
|
readingsBulkUpdate($hash,'channelMedia','-');
|
||||||
@ -380,7 +377,7 @@ sub LGTV_WebOS_TimerStatusRequest($) {
|
|||||||
LGTV_WebOS_Open($hash) if( !IsDisabled($name) and not $hash->{CD} );
|
LGTV_WebOS_Open($hash) if( !IsDisabled($name) and not $hash->{CD} );
|
||||||
|
|
||||||
$hash->{helper}{device}{channelguide}{counter} = $hash->{helper}{device}{channelguide}{counter} +1;
|
$hash->{helper}{device}{channelguide}{counter} = $hash->{helper}{device}{channelguide}{counter} +1;
|
||||||
InternalTimer( gettimeofday()+10,"LGTV_WebOS_TimerStatusRequest", $hash, 1 );
|
InternalTimer( gettimeofday()+10,"LGTV_WebOS_TimerStatusRequest", $hash );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub LGTV_WebOS_Set($@) {
|
sub LGTV_WebOS_Set($@) {
|
||||||
@ -590,7 +587,6 @@ sub LGTV_WebOS_Open($) {
|
|||||||
$hash->{CD} = $socket; # sysread / close won't work on fileno
|
$hash->{CD} = $socket; # sysread / close won't work on fileno
|
||||||
$selectlist{$name} = $hash;
|
$selectlist{$name} = $hash;
|
||||||
|
|
||||||
|
|
||||||
Log3 $name, 4, "LGTV_WebOS ($name) - Socket Connected";
|
Log3 $name, 4, "LGTV_WebOS ($name) - Socket Connected";
|
||||||
|
|
||||||
LGTV_WebOS_Handshake($hash);
|
LGTV_WebOS_Handshake($hash);
|
||||||
@ -610,6 +606,8 @@ sub LGTV_WebOS_Close($) {
|
|||||||
delete($hash->{CD});
|
delete($hash->{CD});
|
||||||
delete($selectlist{$name});
|
delete($selectlist{$name});
|
||||||
|
|
||||||
|
readingsSingleUpdate($hash,'state','off',1);
|
||||||
|
|
||||||
Log3 $name, 4, "LGTV_WebOS ($name) - Socket Disconnected";
|
Log3 $name, 4, "LGTV_WebOS ($name) - Socket Disconnected";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -787,7 +785,7 @@ sub LGTV_WebOS_ResponseProcessing($$) {
|
|||||||
if ($keyAccept eq $expectedResponse) {
|
if ($keyAccept eq $expectedResponse) {
|
||||||
|
|
||||||
Log3 $name, 3, "LGTV_WebOS ($name) - Sucessfull WS connection to $hash->{HOST}";
|
Log3 $name, 3, "LGTV_WebOS ($name) - Sucessfull WS connection to $hash->{HOST}";
|
||||||
readingsSingleUpdate($hash, 'state', 'on', 1 );
|
readingsSingleUpdate($hash,'state','on',1);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
LGTV_WebOS_Close($hash);
|
LGTV_WebOS_Close($hash);
|
||||||
@ -990,6 +988,8 @@ sub LGTV_WebOS_WriteReadings($$) {
|
|||||||
readingsBulkUpdate($hash,'channelNextStartTime','-');
|
readingsBulkUpdate($hash,'channelNextStartTime','-');
|
||||||
readingsBulkUpdate($hash,'channelNextEndTime','-');
|
readingsBulkUpdate($hash,'channelNextEndTime','-');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readingsBulkUpdateIfChanged($hash,'state','on');
|
||||||
|
|
||||||
readingsEndUpdate($hash, 1);
|
readingsEndUpdate($hash, 1);
|
||||||
}
|
}
|
||||||
@ -1397,12 +1397,14 @@ sub LGTV_WebOS_PresenceDone($) {
|
|||||||
|
|
||||||
delete($hash->{helper}{RUNNING_PID});
|
delete($hash->{helper}{RUNNING_PID});
|
||||||
|
|
||||||
Log3 $name, 4, "Sub LGTV_WebOS_PresenceDone ($name) - Der Helper ist diabled. Daher wird hier abgebrochen" if($hash->{helper}{DISABLED});
|
Log3 $name, 4, "Sub LGTV_WebOS_PresenceDone ($name) - Helper is disabled. Stop processing" if($hash->{helper}{DISABLED});
|
||||||
return if($hash->{helper}{DISABLED});
|
return if($hash->{helper}{DISABLED});
|
||||||
|
|
||||||
readingsSingleUpdate($hash, 'presence', $response, 1);
|
readingsSingleUpdate($hash, 'presence', $response, 1);
|
||||||
|
|
||||||
Log3 $name, 4, "Sub LGTV_WebOS_PresenceDone ($name) - Abschluss!";
|
LGTV_WebOS_SocketClosePresenceAbsent($hash,$response);
|
||||||
|
|
||||||
|
Log3 $name, 4, "Sub LGTV_WebOS_PresenceDone ($name) - presence done";
|
||||||
}
|
}
|
||||||
|
|
||||||
sub LGTV_WebOS_PresenceAborted($) {
|
sub LGTV_WebOS_PresenceAborted($) {
|
||||||
@ -1417,6 +1419,18 @@ sub LGTV_WebOS_PresenceAborted($) {
|
|||||||
Log3 $name, 4, "Sub LGTV_WebOS_PresenceAborted ($name) - The BlockingCall Process terminated unexpectedly. Timedout!";
|
Log3 $name, 4, "Sub LGTV_WebOS_PresenceAborted ($name) - The BlockingCall Process terminated unexpectedly. Timedout!";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub LGTV_WebOS_SocketClosePresenceAbsent($$) {
|
||||||
|
|
||||||
|
my ($hash,$presence) = @_;
|
||||||
|
|
||||||
|
my $name = $hash->{NAME};
|
||||||
|
|
||||||
|
|
||||||
|
LGTV_WebOS_Close($hash)
|
||||||
|
if( $presence eq 'absent' and not IsDisabled($name) and $hash->{CD} ); # https://forum.fhem.de/index.php/topic,66671.msg694578.html#msg694578
|
||||||
|
# Sobald pingPresence absent meldet und der Socket noch steht soll er geschlossen werden, da sonst FHEM nach 4-6 min für 10 min blockiert
|
||||||
|
}
|
||||||
|
|
||||||
sub LGTV_WebOS_WakeUp_Udp($@) {
|
sub LGTV_WebOS_WakeUp_Udp($@) {
|
||||||
|
|
||||||
my ($hash,$mac_addr,$host,$port) = @_;
|
my ($hash,$mac_addr,$host,$port) = @_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user