diff --git a/contrib/DS_Starter/60_Watches.pm b/contrib/DS_Starter/60_Watches.pm index 77a71fed4..16ea875c3 100644 --- a/contrib/DS_Starter/60_Watches.pm +++ b/contrib/DS_Starter/60_Watches.pm @@ -1,5 +1,5 @@ ######################################################################################################################## -# $Id: $ +# $Id: 60_Watches.pm 22020 2020-05-24 07:39:02Z DS_Starter $ ######################################################################################################################### # 60_Watches.pm # @@ -71,6 +71,7 @@ BEGIN { # Versions History intern my %vNotesIntern = ( + "0.24.0" => "26.05.2020 entry of countDownInit can be in format ", "0.23.2" => "20.05.2020 english commandref ", "0.23.1" => "10.05.2020 some more changes for PBP severity 3 ", "0.23.0" => "10.05.2020 attr 'digitalBorderDistance' now also valid for digital watches, some changes for PBP ", @@ -216,7 +217,7 @@ sub Set { ## no critic 'compl $prop = ($prop ne "") ? $prop : 70; # Stunden $prop1 = ($prop1 ne "") ? $prop1 : 70; # Minuten $prop2 = ($prop2 ne "") ? $prop2 : 70; # Sekunden - return qq{The value for "$opt" is invalid. Use parameter "hh mm ss" like "19 45 13".} if($prop>24 || $prop1>59 || $prop2>59); + return qq{The value for "$opt" is invalid. Use parameter "hh mm ss" like "19 45 13".} if($prop>23 || $prop1>59 || $prop2>59); my $at = sprintf("%02d",$prop).":".sprintf("%02d",$prop1).":".sprintf("%02d",$prop2); @@ -228,13 +229,19 @@ sub Set { ## no critic 'compl delReadings ($name, "alarmed"); } elsif ($opt eq "countDownInit") { - $prop = ($prop ne "") ? $prop : 70; # Stunden - $prop1 = ($prop1 ne "") ? $prop1 : 70; # Minuten - $prop2 = ($prop2 ne "") ? $prop2 : 70; # Sekunden - return qq{The value for "$opt" is invalid. Use parameter "hh mm ss" like "19 45 13".} if($prop>24 || $prop1>59 || $prop2>59); + my $ct; + if($prop && $prop1) { # Format: hh mm ss + $prop2 = ($prop2 ne "") ? $prop2 : 70; # Sekunden + return qq{The value for "$opt" is invalid. Use parameter "hh mm ss" like "19 45 13" \nor alternatively only one entry in seconds.} if($prop>23 || $prop1>59 || $prop2>59); + $ct = $prop*3600 + $prop1*60 + $prop2; # in Sekunden umgewandelt ! + + } elsif ($prop && !$prop1) { # Format: Sekundenangabe + $ct = $prop; + + } else { + return qq{The value for "$opt" is invalid. Use parameter "hh mm ss" like "19 45 13" \nor alternatively only one entry in seconds.}; - my $st = int(time*1000); # Millisekunden ! - my $ct = $prop*3600 + $prop1*60 + $prop2; # Sekunden ! + } delReadings ($name, "countInitVal"); @@ -277,7 +284,7 @@ sub Set { ## no critic 'compl readingsSingleUpdate($hash, "state", "initialized", 1); } elsif ($opt eq "time") { - return qq{The value for "$opt" is invalid. Use parameter "hh mm ss" like "19 45 13".} if($prop>24 || $prop1>59 || $prop2>59); + return qq{The value for "$opt" is invalid. Use parameter "hh mm ss" like "19 45 13".} if($prop>23 || $prop1>59 || $prop2>59); readingsBeginUpdate ($hash); readingsBulkUpdate ($hash, "hour", $prop); @@ -2355,7 +2362,7 @@ As time source the client (browser time) as well as the FHEM server can be set
  • alarmSet <hh> <mm> <ss>
    - Sets the alarm time in the format hh hours (24), mm minutes and ss seconds.
    + Sets the alarm time in the format hh hours, mm minutes and ss seconds.
    If the time reaches the defined value, an event of the reading "alarmed" is triggered.
    This set command is only available for digital stopwatches.

    @@ -2376,13 +2383,15 @@ As time source the client (browser time) as well as the FHEM server can be set
    -
  • countDownInit <hh> <mm> <ss>
    - Sets the start time of a countdown stopwatch with hh hours(24), mm minutes and ss seconds.
    +
  • countDownInit <hh> <mm> <ss> | <seconds>
    + Sets the start time of a countdown stopwatch. + The format can be <hh> hours, <mm> minutes and <ss> seconds or alternatively only one entry in seconds.
    This set command is only available with a digital countdown stopwatch.


    @@ -2448,7 +2457,7 @@ As time source the client (browser time) as well as the FHEM server can be set
  • time <hh> <mm> <ss>
    - Sets a static time display with hh hours(24), mm minutes and ss seconds.
    + Sets a static time display with hh hours, mm minutes and ss seconds.
    This set command is only available for a digital clock with static time display.