mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 13:26:02 +00:00
60_Watches: contrib 0.20.1
git-svn-id: https://svn.fhem.de/fhem/trunk@21893 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
1bb77dbac5
commit
d8d689838c
@ -71,6 +71,7 @@ BEGIN {
|
|||||||
|
|
||||||
# Versions History intern
|
# Versions History intern
|
||||||
my %vNotesIntern = (
|
my %vNotesIntern = (
|
||||||
|
"0.20.1" => "07.05.2020 asynchron read digital text fixes ",
|
||||||
"0.20.0" => "07.05.2020 asynchron read alarmTime reading, some fixes ",
|
"0.20.0" => "07.05.2020 asynchron read alarmTime reading, some fixes ",
|
||||||
"0.19.0" => "06.05.2020 alarm event creation for watch models 'Station' and 'Station' ",
|
"0.19.0" => "06.05.2020 alarm event creation for watch models 'Station' and 'Station' ",
|
||||||
"0.18.0" => "06.05.2020 attr 'digitalTextTicker' deleted and switched to setter 'textTicker', default text switched to blank ",
|
"0.18.0" => "06.05.2020 attr 'digitalTextTicker' deleted and switched to setter 'textTicker', default text switched to blank ",
|
||||||
@ -497,9 +498,10 @@ sub digitalWatch {
|
|||||||
var seconds_$d;
|
var seconds_$d;
|
||||||
var startDate_$d;
|
var startDate_$d;
|
||||||
var armtime0_$d = '$alarm'; // Alarmzeit initialisieren
|
var armtime0_$d = '$alarm'; // Alarmzeit initialisieren
|
||||||
var value_$d = ' $deftxt'; // default Digitaltext initialisieren
|
var digitxt_$d = ' $deftxt'; // default Digitaltext initialisieren
|
||||||
var tlength_$d = '$txtc'; // Textlänge Digitaltext initialisieren
|
var tlength_$d = '$txtc'; // Textlänge Digitaltext initialisieren
|
||||||
var tticker_$d = '$rdtt'; // Tickereinstellung initialisieren
|
var tticker_$d = '$rdtt'; // Tickereinstellung initialisieren
|
||||||
|
var zmodulo_$d = 0; // Hilfszähler
|
||||||
|
|
||||||
function SegmentDisplay_$d(displayId_$d) {
|
function SegmentDisplay_$d(displayId_$d) {
|
||||||
this.displayId_$d = displayId_$d;
|
this.displayId_$d = displayId_$d;
|
||||||
@ -1317,7 +1319,7 @@ sub digitalWatch {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (watchkind_$d == 'text') {
|
if (watchkind_$d == 'text') {
|
||||||
tlength_$d = value_$d.length-1; // Länge des Textes abzgl. 1 für ' '
|
tlength_$d = digitxt_$d.length-1; // Länge des Textes abzgl. 1 für ' '
|
||||||
if($adtdn) {
|
if($adtdn) {
|
||||||
tlength_$d = $adtdn;
|
tlength_$d = $adtdn;
|
||||||
}
|
}
|
||||||
@ -1328,35 +1330,44 @@ sub digitalWatch {
|
|||||||
}
|
}
|
||||||
display_$d.pattern += ' '; // Abstand Text zum rechten Rand
|
display_$d.pattern += ' '; // Abstand Text zum rechten Rand
|
||||||
|
|
||||||
if (tticker_$d == 'on') { // Text als Laufband ?
|
|
||||||
var rttime = new Date();
|
var rttime = new Date();
|
||||||
var rthours = rttime.getHours();
|
var rthours = rttime.getHours();
|
||||||
var rtminutes = rttime.getMinutes();
|
var rtminutes = rttime.getMinutes();
|
||||||
var rtseconds = rttime.getSeconds();
|
var rtseconds = rttime.getSeconds();
|
||||||
var rtmillis = rttime.getMilliseconds();
|
var rtmillis = rttime.getMilliseconds();
|
||||||
|
|
||||||
var text = '$forerun'+value_$d+' ';
|
modulo_$d = rtseconds % 2; // Taktung für Readingabruf (Serverauslastung reduzieren)
|
||||||
var index = ( 2 * (rtseconds + 60*rtminutes + 24*60*rthours) + Math.floor(rtmillis / 500) ) % (text.length - 6);
|
|
||||||
value_$d = text.substr(index, $txtc+parseInt(1));
|
|
||||||
|
|
||||||
|
if (tticker_$d == 'on') { // Text als Laufband ?
|
||||||
|
var text = '$forerun'+digitxt_$d+' ';
|
||||||
|
var index = ( 2 * (rtseconds + 60*rtminutes + 24*60*rthours) + Math.floor(rtmillis / 500) ) % (text.length - 6);
|
||||||
|
value_$d = text.substr(index, tlength_$d+parseInt(1));
|
||||||
|
|
||||||
|
} else {
|
||||||
|
value_$d = digitxt_$d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (modulo_$d != zmodulo_$d) {
|
||||||
command = '{ReadingsVal(\"$d\",\"displayText\", \"$deftxt\")}'; // Text dynamisch aus Reading lesen
|
command = '{ReadingsVal(\"$d\",\"displayText\", \"$deftxt\")}'; // Text dynamisch aus Reading lesen
|
||||||
url_$d = makeCommand(command);
|
url_$d = makeCommand(command);
|
||||||
\$.get( url_$d, function (data) {
|
\$.get( url_$d, function (data) {
|
||||||
value_$d = data.replace(/\\n/g, '');
|
digitxt_$d = data.replace(/\\n/g, '');
|
||||||
value_$d = ' '+value_$d;
|
digitxt_$d = ' '+digitxt_$d;
|
||||||
return value_$d;
|
return digitxt_$d;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (modulo_$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, '');
|
||||||
|
zmodulo_$d = modulo_$d;
|
||||||
return tticker_$d;
|
return tticker_$d;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
value_$d = ' '+$ddt;
|
value_$d = ' '+$ddt;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user