fixed error in zoneoverlay without duration

This commit is contained in:
Philipp Wo 2019-12-04 10:31:40 +01:00
parent 9f3291cb78
commit 4fa3c57d35
1 changed files with 3 additions and 3 deletions

View File

@ -288,10 +288,9 @@ sub TadoAPI_Get(@) {
my @data = TadoAPI_GetMobileDevices($hash);
$message = "Device List:\n";
foreach my $item ( @data ){
print "\n";
$message .= $item->{'name'} . ": " . $item->{'id'} . "\n";
};
Log3 $name, 3, "TadoAPI $name" . ": " . "$cmd finished\n";
Log3 $name, 3, "TadoAPI $name" . ": " . "$cmd finished";
last;
};
# only for testing
@ -571,7 +570,7 @@ sub TadoAPI_SetZoneOverlayById(@){
Log3 $name, 5, "TadoAPI $name" . ": SetOverlay for Zone $zoneID (Setting: " . $setting . ") - " . "query-URL: $URL";
my $dt = time();
$dt += $duration;
$dt += $duration if defined($duration);
# remove overlay
if($setting eq "off"){
@ -1194,6 +1193,7 @@ sub TadoAPI_GetMobileDevices(@) {
# default case
return @devices;
}elsif(ref($decoded_data) eq 'HASH'){
# error, api response is a hash in case of error
Log3 $name, 3, "TadoAPI $name" . ": " . "GetMobileDevices: " . $decoded_data->{'errors'}->[0]->{'code'} if (exists($decoded_data->{'errors'}));
}
}