mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
now STATE can be changed by stateFormat
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@6334 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
147a18a07f
commit
b2eaa242c0
@ -68,7 +68,8 @@ sub WOL_Set($@) {
|
|||||||
RemoveInternalTimer($hash);
|
RemoveInternalTimer($hash);
|
||||||
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "WOL_UpdateReadings", $hash, 0);
|
InternalTimer(gettimeofday()+$hash->{INTERVAL}, "WOL_UpdateReadings", $hash, 0);
|
||||||
|
|
||||||
if ($hash->{STATE} eq "on") {
|
my $state = ReadingsVal($hash->{NAME}, "state", "nF");
|
||||||
|
if ($state eq "on") {
|
||||||
WOL_GetUpdate($hash);
|
WOL_GetUpdate($hash);
|
||||||
}
|
}
|
||||||
return undef;
|
return undef;
|
||||||
@ -148,14 +149,15 @@ sub WOL_UpdateReadings($) {
|
|||||||
sub WOL_GetUpdate($) {
|
sub WOL_GetUpdate($) {
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
|
|
||||||
if ($hash->{STATE} eq "on") {
|
my $state = ReadingsVal($hash->{NAME}, "state", "nF");
|
||||||
|
if ($state eq "on") {
|
||||||
wake($hash);
|
wake($hash);
|
||||||
}
|
if ($hash->{REPEAT} > 0) {
|
||||||
|
|
||||||
if ($hash->{REPEAT} > 0 && $hash->{STATE} eq "on" ) {
|
|
||||||
InternalTimer(gettimeofday()+$hash->{REPEAT}, "WOL_GetUpdate", $hash, 0);
|
InternalTimer(gettimeofday()+$hash->{REPEAT}, "WOL_GetUpdate", $hash, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
################################################################################
|
################################################################################
|
||||||
sub wake($){
|
sub wake($){
|
||||||
my ($hash) = @_;
|
my ($hash) = @_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user