From 8ae7068943ece2510c8e4a8cc3bcdd37a0ae9b44 Mon Sep 17 00:00:00 2001 From: dietmar63 <> Date: Sun, 13 Apr 2014 19:17:22 +0000 Subject: [PATCH] Twilight - german documentation added WOL - Reading "state" added git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@5519 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/59_Twilight.pm | 136 ++++++++++++++++++++++++++++++++++++++++++++ FHEM/98_WOL.pm | 4 +- 2 files changed, 138 insertions(+), 2 deletions(-) diff --git a/FHEM/59_Twilight.pm b/FHEM/59_Twilight.pm index a550b6431..190892b44 100644 --- a/FHEM/59_Twilight.pm +++ b/FHEM/59_Twilight.pm @@ -286,6 +286,16 @@ sub myRemoveInternalTimer($$) { RemoveInternalTimer($myHash); } } +######################################################################## +sub myGetHashIndirekt ($$) { + my ($myHash, $function) = @_; + + if (!defined($myHash->{HASH})) { + Log 3, "[$function] myHash not valid"; + return undef; + }; + return $myHash->{HASH}; +} ################################################################################ sub Twilight_Midnight($) { my ($myHash) = @_; @@ -731,4 +741,130 @@ sub twilight($$$$) { =end html + +=begin html_DE + +

Twilight

+ + +=end html_DE =cut diff --git a/FHEM/98_WOL.pm b/FHEM/98_WOL.pm index 5eaefce3c..9151d55af 100644 --- a/FHEM/98_WOL.pm +++ b/FHEM/98_WOL.pm @@ -45,10 +45,10 @@ sub WOL_Set($@) { Log3 $hash, 3, "[$name] set $name $v"; if ($v eq "on") { - $hash->{STATE} = $v; + readingsSingleUpdate($hash, "state", $v, 1); Log3 $hash, 3, "[$name] waking $name with MAC $hash->{MAC} IP $hash->{IP} "; } elsif ($v eq "off") { - $hash->{STATE} = $v; + readingsSingleUpdate($hash, "state", $v, 1); my $cmd = AttrVal($name, "shutdownCmd", ""); if ($cmd eq "") { Log3 $hash, 3, "[$name] no shutdown command given (see shutdownCmd attribute)!";