mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
60_Watches.pm: contrib 0.27.0
git-svn-id: https://svn.fhem.de/fhem/trunk@22585 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
cbeb5fc105
commit
178b54d4d8
@ -120,6 +120,14 @@ my %hcb = ( # H
|
|||||||
4 => {cmd => "reset", img => "default/remotecontrol/black_btn_STOP.png", },
|
4 => {cmd => "reset", img => "default/remotecontrol/black_btn_STOP.png", },
|
||||||
);
|
);
|
||||||
|
|
||||||
|
my %hset = ( # Hash der Set-Werte
|
||||||
|
staticwatch => {set => "time" },
|
||||||
|
stopwatch => {set => "alarmSet alarmDel:noArg reset:noArg resume:noArg start:noArg stop:noArg" },
|
||||||
|
countdownwatch => {set => "alarmSet alarmDel:noArg reset:noArg resume:noArg start:noArg stop:noArg countDownInit" },
|
||||||
|
watch => {set => "alarmSet alarmDel:noArg" },
|
||||||
|
text => {set => "displayTextSet displayTextDel:noArg textTicker:on,off" },
|
||||||
|
);
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
# Initialize Funktion
|
# Initialize Funktion
|
||||||
##############################################################################
|
##############################################################################
|
||||||
@ -210,16 +218,17 @@ sub Set { ## no critic 'compl
|
|||||||
my $prop1 = $a[3];
|
my $prop1 = $a[3];
|
||||||
my $prop2 = $a[4];
|
my $prop2 = $a[4];
|
||||||
my $prop3 = $a[5];
|
my $prop3 = $a[5];
|
||||||
my $addp = AttrVal($name, "digitalDisplayPattern", "watch");
|
|
||||||
|
|
||||||
return if(IsDisabled($name));
|
return if(IsDisabled($name));
|
||||||
|
|
||||||
|
my $addp = AttrVal($name, "digitalDisplayPattern", "watch");
|
||||||
|
if (!$hset{$addp}) {
|
||||||
|
Log3($name, 1, "$name - ERROR - The attribute 'digitalDisplayPattern' value '$addp' is not known by module '$hash->{TYPE}'");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
my $setlist = "Unknown argument $opt, choose one of ";
|
my $setlist = "Unknown argument $opt, choose one of ";
|
||||||
$setlist .= "time " if($addp =~ /staticwatch/x);
|
$setlist .= "$hset{$addp}{set} ";
|
||||||
$setlist .= "alarmSet alarmDel:noArg reset:noArg resume:noArg start:noArg stop:noArg " if($addp =~ /stopwatch|countdownwatch/x);
|
|
||||||
$setlist .= "countDownInit " if($addp =~ /countdownwatch/x);
|
|
||||||
$setlist .= "alarmSet alarmDel:noArg " if($addp =~ /\bwatch\b/x);
|
|
||||||
$setlist .= "displayTextSet displayTextDel:noArg textTicker:on,off " if($addp eq "text");
|
|
||||||
|
|
||||||
if ($opt eq "start") { ## no critic 'Cascading'
|
if ($opt eq "start") { ## no critic 'Cascading'
|
||||||
return qq{Please set "countDownInit" before !} if($addp =~ /countdownwatch/x && !ReadingsVal($name, "countInitVal", ""));
|
return qq{Please set "countDownInit" before !} if($addp =~ /countdownwatch/x && !ReadingsVal($name, "countInitVal", ""));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user