siku2 / hass-srf-weather

SRF Meteo forecasts for Home Assistant
MIT License
8 stars 3 forks source link

failed to update weather: Attempt to decode JSON with unexpected mimetype #7

Closed agners closed 2 years ago

agners commented 2 years ago

It seems that something broke this integration

2022-04-08 09:23:39 ERROR (MainThread) [custom_components.srf_weather.weather] failed to update weather
Traceback (most recent call last):
  File "/workspaces/core/config/custom_components/srf_weather/weather.py", line 297, in async_update
    await self.__update()
  File "/workspaces/core/config/custom_components/srf_weather/weather.py", line 211, in __update
    data = await _get(self.hass, self._api_data, url)
  File "/workspaces/core/config/custom_components/srf_weather/weather.py", line 119, in _get
    data = await resp.json()
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1103, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://api.srgssr.ch/srf-meteo/forecast/x,y')
agners commented 2 years ago

Fixed by #8.

agners commented 2 years ago

FWIW, also added the logos to the brands repo: https://github.com/home-assistant/brands/pull/3329

@siku2 what do you think, with this fixed is it maybe time for a new release?

siku2 commented 2 years ago

Thanks for reminding me. I was gonna create a new release after merging your PR but then completely forgot about it.

siku2 commented 2 years ago

Life got in the way, but I finally managed to release a new version!