Skip to content

open-meteo fails when requesting the weather in the standard temperature units (Kelvin) #481

@jjacobowitz

Description

@jjacobowitz

Prerequisites

Please confirm the following:

  • I have searched open and closed issues to make sure it isn't already reported
  • I reviewed the troubleshooting guide
  • I reviewed InkyPi service logs and will paste any relevant logs below

Describe the bug
open-meteo does not appear to support temperature_unit=kelvin so the request fails.

Expected behavior
When setting the unit system to standard while using open-meteo the request should succeed and the temperature should be displayed in Kelvin.

To Reproduce
Steps to reproduce the behavior:

  1. Set the weather provider to "Open-Meteo."
  2. Set the units to "Standard (K)."
  3. Save.
  4. Force an update.

Logs

16:25:10 - ERROR - root - Failed to retrieve Open-Meteo weather data: b'{"error":true,"reason":"Data corrupted at path \'temperature_unit\'. Cannot initialize TemperatureUnit from invalid String value kelvin."}'
16:25:10 - ERROR - plugins.weather.weather - OpenMeteo request failed: Failed to retrieve Open-Meteo weather data.
16:25:10 - ERROR - refresh_task - Exception during refresh
Traceback (most recent call last):
  File "/home/InkyPi/src/plugins/weather/weather.py", line 109, in generate_image
    weather_data = self.get_open_meteo_data(lat, long, units, forecast_days + 1)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/InkyPi/src/plugins/weather/weather.py", line 715, in get_open_meteo_data
    raise RuntimeError("Failed to retrieve Open-Meteo weather data.")
RuntimeError: Failed to retrieve Open-Meteo weather data.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/InkyPi/src/refresh_task.py", line 114, in _run
    image = refresh_action.execute(plugin, self.device_config, current_dt)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/InkyPi/src/refresh_task.py", line 279, in execute
    image = plugin.generate_image(self.plugin_instance.settings, device_config)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "home/InkyPi/src/plugins/weather/weather.py", line 118, in generate_image
    raise RuntimeError(f"{weather_provider} request failure, please check logs.")
RuntimeError: OpenMeteo request failure, please check logs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions