From 73eec1d0aeae2b62d1eb2e848b3f90da34986b10 Mon Sep 17 00:00:00 2001 From: Beta-User <> Date: Thu, 19 Mar 2020 11:07:03 +0000 Subject: [PATCH] 98_RandomTimer: add optional variations parameter git-svn-id: https://svn.fhem.de/fhem/trunk@21449 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 + fhem/FHEM/98_RandomTimer.pm | 51 +++++++++++++++++---- fhem/FHEM/lib/AttrTemplate/httpmod.template | 2 +- 3 files changed, 44 insertions(+), 11 deletions(-) diff --git a/fhem/CHANGED b/fhem/CHANGED index 0e15e7da0..42ac2f141 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # 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: 98_RandomTimer: Add "variations" parameter to further randomize + possible switching times - feature: 77_SMAEM: add define option - bugfix: 98_WeekdayTimer: prevent crashes related to weekprofile changes - bugfix: 93_DbRep: fix user rights check for index operation diff --git a/fhem/FHEM/98_RandomTimer.pm b/fhem/FHEM/98_RandomTimer.pm index 7017dee41..cbaf14286 100644 --- a/fhem/FHEM/98_RandomTimer.pm +++ b/fhem/FHEM/98_RandomTimer.pm @@ -77,10 +77,10 @@ sub RandomTimer_Define($$) { my ($hash, $def) = @_; RemoveInternalTimer($hash); - my ($name, $type, $timespec_start, $device, $timespec_stop, $timeToSwitch) = + my ($name, $type, $timespec_start, $device, $timespec_stop, $timeToSwitch, $variation) = split("[ \t][ \t]*", $def); - return "wrong syntax: define RandomTimer " + return "wrong syntax: define RandomTimer []" if(!defined $timeToSwitch); return "Wrong timespec_start <$timespec_start>, use \"[+][*]