diff --git a/apps/openweathermap/restapi/custom/api.pm b/apps/openweathermap/restapi/custom/api.pm index 8161359d1..207e36461 100644 --- a/apps/openweathermap/restapi/custom/api.pm +++ b/apps/openweathermap/restapi/custom/api.pm @@ -146,7 +146,7 @@ sub request_api { $self->{output}->add_option_msg(short_msg => "Cannot decode json response: $@"); $self->{output}->option_exit(); } - if (!defined($decoded->{code}) || $decoded->{code} != 200) { + if (!defined($decoded->{cod}) || $decoded->{cod} != 200) { $self->{output}->output_add(long_msg => "Error message : " . $decoded->{errorDetails}, debug => 1); $self->{output}->add_option_msg(short_msg => "API return error code '" . $decoded->{result} . "' (add --debug option for detailed message)"); $self->{output}->option_exit(); diff --git a/apps/openweathermap/restapi/plugin.pm b/apps/openweathermap/restapi/plugin.pm index 292fd5524..1e67106c3 100644 --- a/apps/openweathermap/restapi/plugin.pm +++ b/apps/openweathermap/restapi/plugin.pm @@ -35,7 +35,7 @@ sub new { ); $self->{custom_modes}{api} = 'apps::openweathermap::restapi::custom::api'; - return $self;² + return $self; } 1;