FHEM Forum

FHEM - Hausautomations-Systeme => Unterstützende Dienste => Kalendermodule => Thema gestartet von: Nestor am 29 Juli 2019, 10:44:44

Titel: 98_RandomTimer commandref fixes
Beitrag von: Nestor am 29 Juli 2019, 10:44:44
Attached patch fixes some errors and missing attributes in the commandref.

Also these readings should be translated to english (but could break dependencies for these readings in existing installations):

--- 98_RandomTimer.pm (saved version)
+++ (current document)
@@ -323,8 +323,8 @@
   RandomTimer_stopZeitErmitteln ($hash, $now);

   readingsBeginUpdate($hash);
-  readingsBulkUpdate ($hash,  "Startzeit", FmtDateTime($hash->{helper}{startTime}));
-  readingsBulkUpdate ($hash,  "Stoppzeit", FmtDateTime($hash->{helper}{stopTime}));
+  readingsBulkUpdate ($hash,  "StartTime", FmtDateTime($hash->{helper}{startTime}));
+  readingsBulkUpdate ($hash,  "StopTime", FmtDateTime($hash->{helper}{stopTime}));
   readingsEndUpdate  ($hash,  defined($hash->{LOCAL} ? 0 : 1));

}
Titel: Antw:98_RandomTimer commandref fixes
Beitrag von: Beta-User am 29 Juli 2019, 12:08:39
Thx for the cref patch.

Most of the cref stuff has been changed (not the [], indicating optional arguments), and also the reading names. The original code with the german reading names has just been disabled, so in case anyone needs it for transitional purpose it can easily be enabled additionally to the new ones.
Titel: Antw:98_RandomTimer commandref fixes
Beitrag von: Nestor am 29 Juli 2019, 12:11:50
Thanks but <timeToSwitch> is a required parameter (see line 80)
Titel: Antw:98_RandomTimer commandref fixes
Beitrag von: Beta-User am 29 Juli 2019, 12:46:25
Thx, will update that also :) .
Titel: Antw:98_RandomTimer commandref fixes
Beitrag von: Nestor am 02 August 2019, 13:24:32
This patch adds a reading LastCommand, which stores the last executed device command.
It's currently only logged to system log (with verbose 4).

--- - 2019-08-02 13:20:56.690576395 +0200
+++ /srv/fhem/FHEM/98_RandomTimer.pm 2019-08-02 10:36:06.298376369 +0200
@@ -173,6 +173,7 @@
    }
    $command =~ s/@/$hash->{DEVICE}/g;
    $command = SemicolonEscape($command);
+   readingsSingleUpdate($hash, 'LastCommand', $command, 1);
    Log3 $hash, 4, "[".$hash->{NAME}. "]"." command: $command";

    my $ret  = AnalyzeCommandChain(undef, $command);
Titel: Antw:98_RandomTimer commandref fixes
Beitrag von: Beta-User am 02 August 2019, 14:27:29
Thx for the proposal  :) .

Just commited it to svn.