Merge pull request #1 from michaellampert/devel

Einfügen Attribut wakeupCmd
This commit is contained in:
Leon Gaultier 2019-07-02 11:26:24 +02:00 committed by GitHub
commit 91e3f864ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -183,6 +183,7 @@ sub LGTV_WebOS_Initialize($) {
. "pingPresence:1 "
. "wakeOnLanMAC "
. "wakeOnLanBroadcast "
. "wakeupCmd "
. $readingFnAttributes;
foreach my $d ( sort keys %{ $modules{LGTV_WebOS}{defptr} } ) {
@ -424,8 +425,21 @@ sub LGTV_WebOS_Set($@) {
AttrVal( $name, 'wakeOnLanBroadcast', '255.255.255.255' )
);
return;
} elsif( AttrVal($name,'wakeupCmd','none') ne 'none' ) {
my $wakeupCmd = AttrVal($name,'wakeupCmd','none');
if ( $wakeupCmd =~ s/^[ \t]*\{|\}[ \t]*$//g ) {
Log3 $name, 4,
"LGTV_WebOS executing wake-up command (Perl): $wakeupCmd";
eval $wakeupCmd;
return;
}
else {
Log3 $name, 4,
"LGTV_WebOS executing wake-up command (fhem): $wakeupCmd";
fhem $wakeupCmd;
return;
}
} else {
$uri = $lgCommands{powerOn};
}
}
@ -1747,6 +1761,12 @@ sub LGTV_WebOS_WakeUp_Udp($@) {
Broadcast Address of the Network - wakeOnLanBroadcast <network>.255
</ul>
</ul>
<ul>
<ul>
<li>wakeupCmd</li>
Set a command to be executed when turning on an absent device. Can be an FHEM command or Perl command in {}.
</ul>
</ul>
</ul>
=end html
@ -1853,6 +1873,14 @@ sub LGTV_WebOS_WakeUp_Udp($@) {
Broadcast Netzwerkadresse - wakeOnLanBroadcast &lt;netzwerk&gt;.255
</ul>
</ul>
</ul>
<ul>
<ul>
<ul>
<li>wakeupCmd</li>
Befehl zum Einschalten des LG TV. M&ouml;glich ist ein FHEM Befehl oder Perl in {}.
</ul>
</ul>
</ul>
<p><br /><br /><strong>Generierte Readings/Events:</strong></p>
<ul>