mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 12:49:34 +00:00
60_Watches.pm: contrib 0.27.0
git-svn-id: https://svn.fhem.de/fhem/trunk@22589 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
f197c6db38
commit
6a309f1dd3
@ -129,6 +129,9 @@ my %hset = ( #
|
||||
time => {fn => "_setTime" },
|
||||
reset => {fn => "_setReset" },
|
||||
textTicker => {fn => "_setTextTicker" },
|
||||
displayTextDel => {fn => "_setDisplayTextDel" },
|
||||
displayTextSet => {fn => "_setDisplayTextSet" },
|
||||
stop => {fn => "_setStop" },
|
||||
);
|
||||
|
||||
##############################################################################
|
||||
@ -306,19 +309,6 @@ sub Set { ## no critic 'compl
|
||||
readingsSingleUpdate($hash, "starttime", $ms, 0);
|
||||
readingsSingleUpdate($hash, "state", "resumed", 1);
|
||||
|
||||
} elsif ($opt eq "stop") {
|
||||
readingsSingleUpdate($hash, "state", "stopped", 1);
|
||||
|
||||
} elsif ($opt eq "displayTextSet") {
|
||||
shift @a; shift @a;
|
||||
|
||||
my $txt = join (" ", @a);
|
||||
$txt =~ s/[\r\n]//gx;
|
||||
readingsSingleUpdate($hash, "displayText", $txt, 1);
|
||||
|
||||
} elsif ($opt eq "displayTextDel") {
|
||||
delReadings ($name, "displayText");
|
||||
|
||||
} else {
|
||||
return "$setlist";
|
||||
}
|
||||
@ -326,6 +316,49 @@ sub Set { ## no critic 'compl
|
||||
return;
|
||||
}
|
||||
|
||||
################################################################
|
||||
# Setter stop
|
||||
################################################################
|
||||
sub _setStop { ## no critic "not used"
|
||||
my $paref = shift;
|
||||
my $hash = $paref->{hash};
|
||||
|
||||
readingsSingleUpdate($hash, "state", "stopped", 1);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
################################################################
|
||||
# Setter displayTextSet
|
||||
################################################################
|
||||
sub _setDisplayTextSet { ## no critic "not used"
|
||||
my $paref = shift;
|
||||
my $hash = $paref->{hash};
|
||||
my $aref = $paref->{aref};
|
||||
|
||||
my @a = @$aref;
|
||||
|
||||
shift @a; shift @a;
|
||||
|
||||
my $txt = join (" ", @a);
|
||||
$txt =~ s/[\r\n]//gx;
|
||||
readingsSingleUpdate($hash, "displayText", $txt, 1);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
################################################################
|
||||
# Setter displayTextDel
|
||||
################################################################
|
||||
sub _setDisplayTextDel { ## no critic "not used"
|
||||
my $paref = shift;
|
||||
my $name = $paref->{name};
|
||||
|
||||
delReadings ($name, "displayText");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
################################################################
|
||||
# Setter textTicker
|
||||
################################################################
|
||||
@ -346,7 +379,7 @@ return;
|
||||
################################################################
|
||||
# Setter reset
|
||||
################################################################
|
||||
sub _setReset { ## no critic "not used"
|
||||
sub _setReset { ## no critic "not used"
|
||||
my $paref = shift;
|
||||
my $hash = $paref->{hash};
|
||||
my $name = $paref->{name};
|
||||
|
Loading…
Reference in New Issue
Block a user