2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 16:59:18 +00:00

60_Watches: contrib 0.23.0

git-svn-id: https://svn.fhem.de/fhem/trunk@21908 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2020-05-10 07:37:34 +00:00
parent 47b7a673b5
commit 0da80fd0b2

View File

@ -71,6 +71,7 @@ BEGIN {
# Versions History intern # Versions History intern
my %vNotesIntern = ( my %vNotesIntern = (
"0.23.0" => "10.05.2020 attr 'digitalBorderDistance' now also valid for digital watches ",
"0.22.0" => "09.05.2020 new attr 'digitalBorderDistance' for left and rigtht border distance of digital text ", "0.22.0" => "09.05.2020 new attr 'digitalBorderDistance' for left and rigtht border distance of digital text ",
"0.21.1" => "09.05.2020 fix calculate forerun of 'text' dynamically if digitalTextDigitNumber=0 ", "0.21.1" => "09.05.2020 fix calculate forerun of 'text' dynamically if digitalTextDigitNumber=0 ",
"0.21.0" => "08.05.2020 support of alarm time of model digital 'watch' ", "0.21.0" => "08.05.2020 support of alarm time of model digital 'watch' ",
@ -434,7 +435,6 @@ sub digitalWatch {
my $ddt = ReadingsVal ($d, "displayText", $deftxt); my $ddt = ReadingsVal ($d, "displayText", $deftxt);
my $alarm = ReadingsVal ($d, "alarmTime", "aa:bb:cc"); my $alarm = ReadingsVal ($d, "alarmTime", "aa:bb:cc");
my $ddp = "###:##:##"; # dummy
my ($h,$m,$s,$txtc) = (0,0,0,0); my ($h,$m,$s,$txtc) = (0,0,0,0);
my $bdist = ""; # Abstand zum linken und rechten Rand my $bdist = ""; # Abstand zum linken und rechten Rand
@ -450,15 +450,11 @@ sub digitalWatch {
$ddt = "'".$ddt."'"; $ddt = "'".$ddt."'";
} }
if($addp eq "watch") { # Digitaluhr if ($addp eq "stopwatch") {
$ddp = "###:##:##"; $alarmdef = "aa:bb:cc"; # Stoppuhr bei Start 00:00:00 nicht Alerm auslösen
}
} elsif ($addp eq "stopwatch" || $addp eq "countdownwatch") { if ($addp eq "staticwatch") { # statische Uhrzeitanzeige
$alarmdef = "aa:bb:cc" if($addp eq "stopwatch"); # Stoppuhr bei Start 00:00:00 nicht Alerm auslösen
$ddp = "###:##:##";
} else { # statische Uhrzeitanzeige
$ddp = "###:##:##";
$h = ReadingsVal($d, "hour" , 0); $h = ReadingsVal($d, "hour" , 0);
$m = ReadingsVal($d, "minute", 0); $m = ReadingsVal($d, "minute", 0);
$s = ReadingsVal($d, "second", 0); $s = ReadingsVal($d, "second", 0);
@ -530,7 +526,6 @@ sub digitalWatch {
}; };
var display_$d = new SegmentDisplay_$d('display_$d'); var display_$d = new SegmentDisplay_$d('display_$d');
display_$d.pattern = '$ddp '; // Textschablone initialisieren
display_$d.cornerType = 2; display_$d.cornerType = 2;
display_$d.displayAngle = $adda; // Zeichenwinkel: -30 - 30 (9) display_$d.displayAngle = $adda; // Zeichenwinkel: -30 - 30 (9)
display_$d.digitHeight = $addh; // Zeichenhöhe: 5 - 50 (20) display_$d.digitHeight = $addh; // Zeichenhöhe: 5 - 50 (20)
@ -1367,7 +1362,7 @@ sub digitalWatch {
forerun_$d += ' '; forerun_$d += ' ';
} }
display_$d.pattern += distBorderright_$d; // Abstand Text zum rechten Rand display_$d.pattern += distBorderright_$d; // Abstand Text zum rechten Rand
display_$d.pattern = distBorderleft_$d + display_$d.pattern // display_$d.pattern = distBorderleft_$d + display_$d.pattern
if (tticker_$d == 'on') { // Text als Laufband ? if (tticker_$d == 'on') { // Text als Laufband ?
var rttime = new Date(); var rttime = new Date();
@ -1395,7 +1390,7 @@ sub digitalWatch {
} }
if (modulo2_$d != zmodulo_$d) { if (modulo2_$d != zmodulo_$d) {
command = '{ReadingsVal(\"$d\",\"displayTextTicker\", \"off\")}'; // Textticker Einstellung aus Reading lesen command = '{ReadingsVal(\"$d\",\"displayTextTicker\", \"off\")}'; // Textticker Einstellung aus Reading lesen
url_$d = makeCommand(command); url_$d = makeCommand(command);
\$.get( url_$d, function (data) { \$.get( url_$d, function (data) {
tticker_$d = data.replace(/\\n/g, ''); tticker_$d = data.replace(/\\n/g, '');
@ -1405,11 +1400,13 @@ sub digitalWatch {
); );
} }
} else { } else {
value_$d = ' '+$ddt; display_$d.pattern = distBorderleft_$d + '##:##:##' + distBorderright_$d; // Textschablone initialisieren
if(value_$d == ' undefined:undefined:undefined' || value_$d == ' NaN:NaN:NaN') { value_$d = distBorderleft_$d + $ddt;
value_$d = ' : : ';
if(value_$d == distBorderleft_$d + 'undefined:undefined:undefined' || value_$d == distBorderleft_$d + 'NaN:NaN:NaN') {
value_$d = distBorderleft_$d + ' : : ';
} }
} }