cmd ref + fix
This commit is contained in:
@ -201,10 +201,7 @@ sub Set {
|
||||
|
||||
my $name = shift @$aArg // return;
|
||||
my $cmd = shift @$aArg // return qq{"set $name" needs at least one argument};
|
||||
|
||||
# Das Argument für das Passwort, also das Passwort an sich darf keine = enthalten!!!
|
||||
|
||||
|
||||
|
||||
if ( lc $cmd eq 'password' ) {
|
||||
|
||||
my ($passResp,$passErr);
|
||||
@ -221,18 +218,18 @@ sub Set {
|
||||
elsif ( lc $cmd =~ /open|led_brightness|eject_power|eject_delay|detection_area|detection_sensitivity/ ) {
|
||||
return "please set Attribut LiberoIP first"
|
||||
if ( AttrVal( $name, 'LiberoIP', 'none' ) eq 'none' );
|
||||
Log3 $name, 1, "Poste an die Libero";
|
||||
|
||||
getCookie($hash)
|
||||
if (ReadingsVal( $name, 'cookie', 'none' ) eq 'none');
|
||||
|
||||
# cmd = setter, $aArg->[0] = value
|
||||
if (lc $cmd ne 'open') {
|
||||
$payload = 'led=' if (lc $cmd eq 'led_brightness');
|
||||
$payload = 'pwr=' if (lc $cmd eq 'eject_power');
|
||||
$payload = 'dist=' if (lc $cmd eq 'detection_area');
|
||||
$payload = 'delay=' if (lc $cmd eq 'detection_sensitivity');
|
||||
$payload = 'pdelay=' if (lc $cmd eq 'eject_delay');
|
||||
my $payload = '';
|
||||
$payload = 'led='.$aArg->[0] if (lc $cmd eq 'led_brightness');
|
||||
$payload = 'pwr='.$aArg->[0] if (lc $cmd eq 'eject_power');
|
||||
$payload = 'dist='.$aArg->[0] if (lc $cmd eq 'detection_area');
|
||||
$payload = 'delay='.$aArg->[0] if (lc $cmd eq 'detection_sensitivity');
|
||||
$payload = 'pdelay='.$aArg->[0] if (lc $cmd eq 'eject_delay');
|
||||
|
||||
write($hash, $payload)
|
||||
|
||||
|
Reference in New Issue
Block a user