add condition for setter

This commit is contained in:
2020-10-24 09:59:57 +02:00
parent 0e1468a032
commit 1f3ab13b0c
2 changed files with 11 additions and 1 deletions

View File

@ -294,6 +294,16 @@ sub Set {
DeletePassword($hash);
}
elsif ( lc $cmd eq 'active' ) {
return "usage: $cmd" if ( scalar( @{$aArg} ) != 0 );
readingsSingleUpdate( $hash, 'state', $cmd, 1 );
}
elsif ( lc $cmd eq 'inactive' ) {
return "usage: $cmd" if ( scalar( @{$aArg} ) != 0 );
readingsSingleUpdate( $hash, 'state', $cmd, 1 );
}
else {
my $list = 'active:noArg inactive:noArg';
$list .= (