diff --git a/fhem/CHANGED b/fhem/CHANGED index 3e03daca0..ab753199a 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 disabledForIntervals attribute + and active/inactive setters - bugfix: 70_HYDRAWISE: Solves logging problems - bugfix: 93_DbLog: fix line breaks in set function, Forum: #110673 - bugfix: GardenaSmart: all modules change to new API and code PBP conform diff --git a/fhem/FHEM/98_RandomTimer.pm b/fhem/FHEM/98_RandomTimer.pm index 8098c5e94..e08657e5f 100644 --- a/fhem/FHEM/98_RandomTimer.pm +++ b/fhem/FHEM/98_RandomTimer.pm @@ -28,8 +28,10 @@ package FHEM::RandomTimer; ## no critic 'Package declaration' use strict; use warnings; +use utf8; use Time::HiRes qw(gettimeofday); use Time::Local 'timelocal_nocheck'; +use List::Util qw(max); use GPUtils qw(GP_Import GP_Export); ## Import der FHEM Funktionen @@ -51,16 +53,17 @@ BEGIN { AttrVal ReadingsVal Value + IsDisabled Log3 InternalTimer RemoveInternalTimer + CommandDeleteAttr AnalyzeCommandChain AnalyzePerlCommand SemicolonEscape FmtDateTime strftime GetTimeSpec - maxNum stacktrace ) ); } @@ -82,7 +85,7 @@ sub Initialize { $hash->{SetFn} = \&Set; $hash->{AttrFn} = \&Attr; $hash->{AttrList} = "onCmd offCmd switchmode disable:0,1 disableCond disableCondCmd:none,offCmd,onCmd offState ". - "runonce:0,1 keepDeviceAlive:0,1 forceStoptimeSameDay:0,1 ". + "runonce:0,1 keepDeviceAlive:0,1 forceStoptimeSameDay:0,1 disabledForIntervals ". $readingFnAttributes; return; } @@ -99,12 +102,12 @@ sub Define { if(!defined $timeToSwitch); my ($rel, $rep, $tspec); - if ($timespec_start =~ m/^(\+)?(\*)?(.*)$/ix) { + if ($timespec_start =~ m{^(\+)?(\*)?(.*)$}ixms) { $rel = $1; $rep = $2; $tspec = $3; } else { - return "Wrong timespec_start <$timespec_start>, use \"[+][*]