yandex_weather
yandex_weather copied to clipboard
Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8
Ошибка в декодировании JSON
[custom_components.yandex_weather.weather] Error fetching data from Yandex.Weather, 0, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url=URL('https://api.weather.yandex.ru/v2/informers?lat=55.xxxxxx&lon=49.xxxxxx')
геолокацию скрыл
Запросы api отличаются в зависимости от выбранного тарифа. Если выбран тариф "Тестовый", то запрос в строке 247 (informers) base_url="https://api.weather.yandex.ru/v2/informers?lat=%s&lon=%s" % (self._lat, self._lon) Надо поменять на (forecast) на base_url="https://api.weather.yandex.ru/v2/forecast?lat=%s&lon=%s" % (self._lat, self._lon)
https://yandex.ru/dev/weather/doc/dg/concepts/forecast-test.html
Кстати, не забывайте, что API ключ в yaml-е нужно писать в кавычках, я так долго тупил в чём дело