Syntax check for disabledForIntervals
This commit is contained in:
parent
541ca25a65
commit
83daf9bfad
@ -36,7 +36,7 @@ use JSON;
|
|||||||
use Blocking;
|
use Blocking;
|
||||||
|
|
||||||
|
|
||||||
my $version = "1.1.0";
|
my $version = "1.1.1";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -164,6 +164,8 @@ sub XiaomiFlowerSens_Attr(@) {
|
|||||||
|
|
||||||
if( $attrName eq "disabledForIntervals" ) {
|
if( $attrName eq "disabledForIntervals" ) {
|
||||||
if( $cmd eq "set" ) {
|
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";
|
Log3 $name, 3, "XiaomiFlowerSens ($name) - disabledForIntervals";
|
||||||
readingsSingleUpdate ( $hash, "state", "Unknown", 1 );
|
readingsSingleUpdate ( $hash, "state", "Unknown", 1 );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user