mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
60_Watches: set reading 'stoptime' in digital stopwatch
git-svn-id: https://svn.fhem.de/fhem/trunk@22109 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
28e9f82040
commit
d1f7ad4e20
@ -1,5 +1,6 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- feature: 60_Watches: set reading 'stoptime' in digital stopwatch
|
||||
- feature: 58_HVAC_DaikinAC: added on and off shortcut commands so that
|
||||
the module works out-of-the box with other modules that
|
||||
expect those, for example Alexa
|
||||
|
@ -71,6 +71,7 @@ BEGIN {
|
||||
|
||||
# Versions History intern
|
||||
my %vNotesIntern = (
|
||||
"0.25.0" => "03.06.2020 set reading 'stoptime' in type 'stopwatch' ",
|
||||
"0.24.0" => "26.05.2020 entry of countDownInit can be in format <seconds> ",
|
||||
"0.23.2" => "20.05.2020 english commandref ",
|
||||
"0.23.1" => "10.05.2020 some more changes for PBP severity 3 ",
|
||||
@ -169,7 +170,7 @@ sub Define {
|
||||
}
|
||||
|
||||
$hash->{HELPER}{MODMETAABSENT} = 1 if($modMetaAbsent); # Modul Meta.pm nicht vorhanden
|
||||
$hash->{MODEL} = $a[2];
|
||||
$hash->{MODEL} = uc($a[2]);
|
||||
|
||||
setVersionInfo($hash); # Versionsinformationen setzen
|
||||
|
||||
@ -190,7 +191,6 @@ sub Set { ## no critic 'compl
|
||||
my $prop1 = $a[3];
|
||||
my $prop2 = $a[4];
|
||||
my $prop3 = $a[5];
|
||||
my $model = $hash->{MODEL};
|
||||
my $addp = AttrVal($name, "digitalDisplayPattern", "watch");
|
||||
|
||||
return if(IsDisabled($name));
|
||||
@ -498,6 +498,7 @@ sub digitalWatch {
|
||||
var zmodulo_$d = 0; // Hilfszähler
|
||||
var distBorderright_$d = '$bdist'; // Abstand zum rechten Rand
|
||||
var distBorderleft_$d = '$bdist'; // Abstand zum linken Rand
|
||||
var allowSetStopTime; // erlaube / verbiete Setzen Reading stoptime
|
||||
|
||||
function SegmentDisplay_$d(displayId_$d) {
|
||||
this.displayId_$d = displayId_$d;
|
||||
@ -1082,11 +1083,12 @@ sub digitalWatch {
|
||||
}
|
||||
|
||||
// localStorage Set
|
||||
function localStoreSet_$d (hours, minutes, seconds, sumsecs) {
|
||||
function localStoreSet_$d (hours, minutes, seconds, sumsecs, aSetStopT) {
|
||||
if (Number.isInteger(hours)) { localStorage.setItem('h_$d', hours); }
|
||||
if (Number.isInteger(minutes)) { localStorage.setItem('m_$d', minutes); }
|
||||
if (Number.isInteger(seconds)) { localStorage.setItem('s_$d', seconds); }
|
||||
if (Number.isInteger(sumsecs)) { localStorage.setItem('ss_$d', sumsecs); }
|
||||
if (Number.isInteger(aSetStopT)) { localStorage.setItem('ast_$d', aSetStopT); }
|
||||
}
|
||||
|
||||
// localStorage speichern letzte Alarmzeit
|
||||
@ -1191,6 +1193,8 @@ sub digitalWatch {
|
||||
);
|
||||
|
||||
if (state_$d == 'started' || state_$d == 'resumed') {
|
||||
localStoreSet_$d (NaN, NaN, NaN, NaN, 1); // set Reading stoptime freischalten
|
||||
|
||||
if (modulo2_$d != zmodulo_$d) {
|
||||
command = '{ReadingsVal("$d","alarmTime","+almtime0_$d+")}'; // alarmTime Reading lesen
|
||||
url_$d = makeCommand(command);
|
||||
@ -1248,6 +1252,16 @@ sub digitalWatch {
|
||||
|
||||
sumsecs_$d = parseInt(hours_$d*3600) + parseInt(minutes_$d*60) + parseInt(seconds_$d);
|
||||
localStoreSet_$d (NaN, NaN, NaN, sumsecs_$d);
|
||||
|
||||
allowSetStopTime = localStorage.getItem('ast_$d');
|
||||
if(allowSetStopTime == 1) {
|
||||
ddt_$d = buildtime (hours_$d, minutes_$d, seconds_$d); // Reading mit Stoppzeit setzen
|
||||
|
||||
command = '{ CommandSetReading(undef, "$d stoptime '+ddt_$d+'") }';
|
||||
url_$d = makeCommand(command);
|
||||
\$.get(url_$d);
|
||||
}
|
||||
localStoreSet_$d (NaN, NaN, NaN, NaN, 0); // set Reading stoptime verbieten
|
||||
}
|
||||
|
||||
if (state_$d == 'initialized') {
|
||||
|
Loading…
Reference in New Issue
Block a user