Merge pull request #2026 from Tpo76/openweathermap

Fix typo
This commit is contained in:
qgarnier 2020-06-02 08:17:51 +02:00 committed by GitHub
commit ece71df12c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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();

View File

@ -35,7 +35,7 @@ sub new {
);
$self->{custom_modes}{api} = 'apps::openweathermap::restapi::custom::api';
return $self;²
return $self;
}
1;