dev #4
@@ -37,6 +37,41 @@ require FHEM::Devices::LGTV::LGTVWebOS;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
use FHEM::Meta;
 | 
					use FHEM::Meta;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use GPUtils qw(GP_Import);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#-- Run before package compilation
 | 
				
			||||||
 | 
					BEGIN {
 | 
				
			||||||
 | 
					    #-- Export to main context with different name
 | 
				
			||||||
 | 
					    GP_Import(qw( readingFnAttributes));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub ::LGTV_WebOS_Initialize { goto &Initialize }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					sub Initialize {
 | 
				
			||||||
 | 
					    my $hash = shift;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Provider
 | 
				
			||||||
 | 
					    $hash->{ReadFn}  = \&FHEM::Devices::LGTV::LGTVWebOS::Read;
 | 
				
			||||||
 | 
					    $hash->{WriteFn} = \&FHEM::Devices::LGTV::LGTVWebOS::Write;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Consumer
 | 
				
			||||||
 | 
					    $hash->{SetFn}   = \&FHEM::Devices::LGTV::LGTVWebOS::Set;
 | 
				
			||||||
 | 
					    $hash->{DefFn}   = \&FHEM::Devices::LGTV::LGTVWebOS::Define;
 | 
				
			||||||
 | 
					    $hash->{UndefFn} = \&FHEM::Devices::LGTV::LGTVWebOS::Undef;
 | 
				
			||||||
 | 
					    $hash->{AttrFn}  = \&FHEM::Devices::LGTV::LGTVWebOS::Attr;
 | 
				
			||||||
 | 
					    $hash->{AttrList} =
 | 
				
			||||||
 | 
					        "disable:1 "
 | 
				
			||||||
 | 
					      . "channelGuide:1 "
 | 
				
			||||||
 | 
					      . "pingPresence:1 "
 | 
				
			||||||
 | 
					      . "wakeOnLanMAC "
 | 
				
			||||||
 | 
					      . "wakeOnLanBroadcast "
 | 
				
			||||||
 | 
					      . "wakeupCmd "
 | 
				
			||||||
 | 
					      . "keepAliveCheckTime "
 | 
				
			||||||
 | 
					      . $readingFnAttributes;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return FHEM::Meta::InitMod( __FILE__, $hash );
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
1;
 | 
					1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=pod
 | 
					=pod
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,2 +1,2 @@
 | 
				
			|||||||
UPD 2022-02-02_14:30:51 18011 FHEM/82_LGTV_WebOS.pm
 | 
					UPD 2022-02-02_15:41:28 18966 FHEM/82_LGTV_WebOS.pm
 | 
				
			||||||
UPD 2022-02-02_15:23:47 54856 lib/FHEM/Devices/LGTV/LGTVWebOS.pm
 | 
					UPD 2022-02-02_15:41:43 54304 lib/FHEM/Devices/LGTV/LGTVWebOS.pm
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -50,7 +50,7 @@ use GPUtils qw(GP_Import);
 | 
				
			|||||||
BEGIN {
 | 
					BEGIN {
 | 
				
			||||||
    #-- Export to main context with different name
 | 
					    #-- Export to main context with different name
 | 
				
			||||||
    GP_Import(
 | 
					    GP_Import(
 | 
				
			||||||
        qw( readingFnAttributes
 | 
					        qw(
 | 
				
			||||||
          modules
 | 
					          modules
 | 
				
			||||||
          init_done
 | 
					          init_done
 | 
				
			||||||
          selectlist
 | 
					          selectlist
 | 
				
			||||||
@@ -59,33 +59,6 @@ BEGIN {
 | 
				
			|||||||
    );
 | 
					    );
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
sub ::LGTV_WebOS_Initialize { goto &Initialize }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
sub Initialize {
 | 
					 | 
				
			||||||
    my $hash = shift;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Provider
 | 
					 | 
				
			||||||
    $hash->{ReadFn}  = \&Read;
 | 
					 | 
				
			||||||
    $hash->{WriteFn} = \&Write;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    # Consumer
 | 
					 | 
				
			||||||
    $hash->{SetFn}   = \&Set;
 | 
					 | 
				
			||||||
    $hash->{DefFn}   = \&Define;
 | 
					 | 
				
			||||||
    $hash->{UndefFn} = \&Undef;
 | 
					 | 
				
			||||||
    $hash->{AttrFn}  = \&Attr;
 | 
					 | 
				
			||||||
    $hash->{AttrList} =
 | 
					 | 
				
			||||||
        "disable:1 "
 | 
					 | 
				
			||||||
      . "channelGuide:1 "
 | 
					 | 
				
			||||||
      . "pingPresence:1 "
 | 
					 | 
				
			||||||
      . "wakeOnLanMAC "
 | 
					 | 
				
			||||||
      . "wakeOnLanBroadcast "
 | 
					 | 
				
			||||||
      . "wakeupCmd "
 | 
					 | 
				
			||||||
      . "keepAliveCheckTime "
 | 
					 | 
				
			||||||
      . $readingFnAttributes;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    return FHEM::Meta::InitMod( __FILE__, $hash );
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
my $missingModul = "";
 | 
					my $missingModul = "";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
eval { require MIME::Base64;     1 } or $missingModul .= 'MIME::Base64 ';
 | 
					eval { require MIME::Base64;     1 } or $missingModul .= 'MIME::Base64 ';
 | 
				
			||||||
@@ -390,7 +363,8 @@ sub TimerStatusRequest {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    else {
 | 
					    else {
 | 
				
			||||||
        ::readingsSingleUpdate( $hash, 'state', 'off', 1 );
 | 
					        ::readingsSingleUpdate( $hash, 'state', 'off', 1 )
 | 
				
			||||||
 | 
					          if ( ::ReadingsVal( $name, 'state', 'off' ) ne 'off' );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        Presence($hash)
 | 
					        Presence($hash)
 | 
				
			||||||
          if ( ::AttrVal( $name, 'pingPresence', 0 ) == 1 );
 | 
					          if ( ::AttrVal( $name, 'pingPresence', 0 ) == 1 );
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user