clean up code
This commit is contained in:
parent
59e267e9b1
commit
0943335044
@ -406,33 +406,18 @@ sub Get {
|
|||||||
my $cmd = shift @$aArg
|
my $cmd = shift @$aArg
|
||||||
// return qq{"get $name" needs at least one argument};
|
// return qq{"get $name" needs at least one argument};
|
||||||
|
|
||||||
|
|
||||||
if ( lc $cmd eq 'debug_devices_list' ) {
|
if ( lc $cmd eq 'debug_devices_list' ) {
|
||||||
my $device = shift @$aArg;
|
my $device = shift @$aArg;
|
||||||
$hash->{helper}{debug_device} = $device;
|
$hash->{helper}{debug_device} = $device;
|
||||||
Write($hash, undef, undef, undef, undef);
|
Write($hash, undef, undef, undef, undef);
|
||||||
#while (!defined ($hash->{helper}{debug_device_output} )){
|
return undef;
|
||||||
# select(undef, undef, undef, 0.5);
|
|
||||||
#}
|
|
||||||
#Log3 $name, 2, "OUTPUT".$hash->{helper}{debug_device_output};
|
|
||||||
#delete $hash->{helper}{debug_device};
|
|
||||||
#delete $hash->{helper}{debug_device_output};
|
|
||||||
|
|
||||||
return undef; #$hash->{helper}{debug_device_output};
|
|
||||||
}elsif ( lc $cmd eq 'debug_device' ) {
|
|
||||||
Log3 $name, 2, "DEBUG DEVICE INFOS Device $hash->{helper}{debug_device}";
|
|
||||||
delete $hash->{helper}{debug_device};
|
|
||||||
return $hash->{helper}{debug_device_output};
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
my $list = "";
|
my $list = "";
|
||||||
$list .= " debug_devices_list:"
|
$list .= " debug_devices_list:"
|
||||||
.join( ',', @{ $hash->{helper}{deviceList} })
|
.join( ',', @{ $hash->{helper}{deviceList} })
|
||||||
if ( AttrVal( $name, "debugJSON", "none") ne "none"
|
if ( AttrVal( $name, "debugJSON", "none") ne "none"
|
||||||
&& exists($hash->{helper}{deviceList}) );
|
&& exists($hash->{helper}{deviceList}) );
|
||||||
|
|
||||||
return "Unknown argument $cmd,choose one of $list";
|
return "Unknown argument $cmd,choose one of $list";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -533,8 +518,6 @@ sub ErrorHandling {
|
|||||||
|
|
||||||
my $dname = $dhash->{NAME};
|
my $dname = $dhash->{NAME};
|
||||||
|
|
||||||
#$param->{cl} = $hash->{CL} if( $hash->{TOKEN} and ref($hash->{CL}) eq 'HASH' );
|
|
||||||
|
|
||||||
Log3 $name, 4, "GardenaSmartBridge ($name) - Request: $data";
|
Log3 $name, 4, "GardenaSmartBridge ($name) - Request: $data";
|
||||||
|
|
||||||
my $decode_json = eval { decode_json($data) };
|
my $decode_json = eval { decode_json($data) };
|
||||||
|
Loading…
x
Reference in New Issue
Block a user