add attribut wakeOnLanBroadcast
This commit is contained in:
parent
336c3e39a3
commit
d94690b16a
@ -67,7 +67,7 @@ use Blocking;
|
||||
|
||||
|
||||
|
||||
my $version = "0.8.4";
|
||||
my $version = "0.8.5";
|
||||
|
||||
|
||||
|
||||
@ -215,6 +215,7 @@ sub LGTV_WebOS_Initialize($) {
|
||||
"channelGuide:1 ".
|
||||
"pingPresence:1 ".
|
||||
"wakeOnLanMAC ".
|
||||
"wakeOnLanBroadcast ".
|
||||
$readingFnAttributes;
|
||||
|
||||
|
||||
@ -437,8 +438,8 @@ sub LGTV_WebOS_Set($@) {
|
||||
if($cmd eq 'off') {
|
||||
$uri = $lgCommands{powerOff};
|
||||
} elsif ($cmd eq 'on') {
|
||||
if( AttrVal($name,'wakeOnLanMAC','none') ne 'none') {
|
||||
LGTV_WebOS_WakeUp_Udp($hash,AttrVal($name,'wakeOnLanMAC',0),$hash->{HOST});
|
||||
if( AttrVal($name,'wakeOnLanMAC','none') ne 'none' and AttrVal($name,'wakeOnLanBroadcast','none') ne 'none') {
|
||||
LGTV_WebOS_WakeUp_Udp($hash,AttrVal($name,'wakeOnLanMAC',0),AttrVal($name,'wakeOnLanBroadcast',0));
|
||||
return;
|
||||
} else {
|
||||
$uri = $lgCommands{powerOn};
|
||||
@ -1422,8 +1423,10 @@ sub LGTV_WebOS_WakeUp_Udp($@) {
|
||||
my ($hash,$mac_addr,$host,$port) = @_;
|
||||
my $name = $hash->{NAME};
|
||||
|
||||
$host = '255.255.255.255' if (!defined $host);
|
||||
|
||||
# use the discard service if $port not passed in
|
||||
if (!defined $port || $port !~ /^\d+$/ ) { $port = 9 }
|
||||
$port = 9 if (!defined $port || $port !~ /^\d+$/ );
|
||||
|
||||
my $sock = new IO::Socket::INET(Proto=>'udp') or die "socket : $!";
|
||||
if(!$sock) {
|
||||
|
Loading…
Reference in New Issue
Block a user