fix current program list readings

This commit is contained in:
Marko Oldenburg 2018-07-22 20:38:30 +02:00
parent 63dd3cd9d9
commit 0f9c39d43b

View File

@ -69,7 +69,7 @@ eval "use Blocking;1" or $missingModul .= "Blocking ";
my $version = "2.0.5";
my $version = "2.0.6";
@ -246,6 +246,7 @@ sub LGTV_WebOS_Define($$) {
$hash->{HOST} = $host;
$hash->{VERSION} = $version;
$hash->{PARTIAL} = '';
$hash->{helper}{device}{channelguide}{counter} = 0;
$hash->{helper}{device}{registered} = 0;
$hash->{helper}{device}{runsetcmd} = 0;
@ -838,6 +839,8 @@ sub LGTV_WebOS_ResponseProcessing($$) {
sub LGTV_WebOS_WriteReadings($$) {
use Date::Parse;
my ($hash,$decode_json) = @_;
my $name = $hash->{NAME};
@ -879,6 +882,7 @@ sub LGTV_WebOS_WriteReadings($$) {
my $count = 0;
foreach my $programList ( @{$decode_json->{payload}{programList}} ) {
if( str2time(LGTV_WebOS_FormartStartEndTime($programList->{localEndTime})) > time() ) {
if($count < 1) {
readingsBulkUpdate($hash,'channelCurrentTitle',$programList->{programName});
@ -896,6 +900,7 @@ sub LGTV_WebOS_WriteReadings($$) {
return if($count > 1);
}
}
}
elsif( defined($decode_json->{payload}{'mute'}) or defined($decode_json->{payload}{'muted'})) {