From 83daf9bfad6b7abb1801e5b74e9a4ff678d949cd Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Thu, 28 Sep 2017 08:42:20 +0200 Subject: [PATCH] Syntax check for disabledForIntervals --- 74_XiaomiFlowerSens.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/74_XiaomiFlowerSens.pm b/74_XiaomiFlowerSens.pm index f5abc56..249471e 100644 --- a/74_XiaomiFlowerSens.pm +++ b/74_XiaomiFlowerSens.pm @@ -36,7 +36,7 @@ use JSON; use Blocking; -my $version = "1.1.0"; +my $version = "1.1.1"; @@ -164,6 +164,8 @@ sub XiaomiFlowerSens_Attr(@) { if( $attrName eq "disabledForIntervals" ) { if( $cmd eq "set" ) { + return "check disabledForIntervals Syntax HH:MM-HH:MM or 'HH:MM-HH:MM HH:MM-HH:MM ...'" + unless($attrVal =~ /^((\d{2}:\d{2})-(\d{2}:\d{2})\s?)+$/); Log3 $name, 3, "XiaomiFlowerSens ($name) - disabledForIntervals"; readingsSingleUpdate ( $hash, "state", "Unknown", 1 ); }