60_Watches: contrib 0.10.0
git-svn-id: https://svn.fhem.de/fhem/trunk@21836 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
@@ -36,6 +36,7 @@ use Time::HiRes qw(time gettimeofday tv_interval);
|
|||||||
|
|
||||||
# Versions History intern
|
# Versions History intern
|
||||||
my %Watches_vNotesIntern = (
|
my %Watches_vNotesIntern = (
|
||||||
|
"0.10.0" => "02.05.2020 renamed 'countDownDone' to 'alarmed', bug fix ",
|
||||||
"0.9.0" => "02.05.2020 new attribute 'timeSource' for selection of client/server time ",
|
"0.9.0" => "02.05.2020 new attribute 'timeSource' for selection of client/server time ",
|
||||||
"0.8.0" => "01.05.2020 new values 'countdownwatch' for attribute digitalDisplayPattern, switch all watches to server time ",
|
"0.8.0" => "01.05.2020 new values 'countdownwatch' for attribute digitalDisplayPattern, switch all watches to server time ",
|
||||||
"0.7.0" => "30.04.2020 new set 'continue' for stopwatch ",
|
"0.7.0" => "30.04.2020 new set 'continue' for stopwatch ",
|
||||||
@@ -132,9 +133,9 @@ sub Watches_Set { ## no criti
|
|||||||
my $ms = int(time*1000);
|
my $ms = int(time*1000);
|
||||||
|
|
||||||
readingsBeginUpdate ($hash);
|
readingsBeginUpdate ($hash);
|
||||||
ReadingsBulkUpdateValue ($hash, "countDownDone", 0) if($addp =~ /countdownwatch/);
|
readingsBulkUpdate ($hash, "alarmed", 0) if($addp =~ /countdownwatch/);
|
||||||
ReadingsBulkUpdateValue ($hash, "starttime", $ms);
|
readingsBulkUpdate ($hash, "starttime", $ms);
|
||||||
ReadingsBulkUpdateValue ($hash, "state", "started");
|
readingsBulkUpdate ($hash, "state", "started");
|
||||||
readingsEndUpdate ($hash, 1);
|
readingsEndUpdate ($hash, 1);
|
||||||
|
|
||||||
} elsif ($opt eq "countDownInit") {
|
} elsif ($opt eq "countDownInit") {
|
||||||
@@ -148,9 +149,9 @@ sub Watches_Set { ## no criti
|
|||||||
|
|
||||||
Watches_delread ($name);
|
Watches_delread ($name);
|
||||||
readingsBeginUpdate ($hash);
|
readingsBeginUpdate ($hash);
|
||||||
ReadingsBulkUpdateValue ($hash, "countDownDone", 0);
|
readingsBulkUpdate ($hash, "alarmed", 0);
|
||||||
ReadingsBulkUpdateValue ($hash, "countInitVal", $ct);
|
readingsBulkUpdate ($hash, "countInitVal", $ct);
|
||||||
ReadingsBulkUpdateValue ($hash, "state", "initialized");
|
readingsBulkUpdate ($hash, "state", "initialized");
|
||||||
readingsEndUpdate ($hash, 1);
|
readingsEndUpdate ($hash, 1);
|
||||||
|
|
||||||
} elsif ($opt eq "continue") {
|
} elsif ($opt eq "continue") {
|
||||||
@@ -1014,7 +1015,12 @@ sub Watches_digital {
|
|||||||
// aktueller Timestamp in Millisekunden
|
// aktueller Timestamp in Millisekunden
|
||||||
command = '{ int(time*1000) }';
|
command = '{ int(time*1000) }';
|
||||||
url_$d = makeCommand(command);
|
url_$d = makeCommand(command);
|
||||||
\$.get( url_$d, function (data) {data = data.replace(/\\n/g, ''); ct_$d = parseInt(data); return ct_$d;} );
|
\$.get( url_$d, function (data) {
|
||||||
|
data = data.replace(/\\n/g, '');
|
||||||
|
ct_$d = parseInt(data);
|
||||||
|
return ct_$d;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
currDate_$d = new Date(ct_$d);
|
currDate_$d = new Date(ct_$d);
|
||||||
|
|
||||||
@@ -1035,8 +1041,7 @@ sub Watches_digital {
|
|||||||
localStoreSet (hours_$d, minutes_$d, seconds_$d);
|
localStoreSet (hours_$d, minutes_$d, seconds_$d);
|
||||||
|
|
||||||
if (hours_$d + minutes_$d + seconds_$d == 0) {
|
if (hours_$d + minutes_$d + seconds_$d == 0) {
|
||||||
Reading_$d = 'countDownDone';
|
command = '{ CommandSetReading(undef, \"'+devName_$d+' alarmed 1\") }';
|
||||||
command = '{ CommandSetReading(undef, \"'+devName_$d+' countDownDone 1\") }';
|
|
||||||
url_$d = makeCommand(command);
|
url_$d = makeCommand(command);
|
||||||
|
|
||||||
\$.get(url_$d, function (data) {
|
\$.get(url_$d, function (data) {
|
||||||
|
|||||||
Reference in New Issue
Block a user