Limych / ha-gismeteo

Gismeteo Weather Provider for Home Assistant
Other
117 stars 21 forks source link

Integration unavailable after a while #100

Closed EVTrifonov closed 2 years ago

EVTrifonov commented 2 years ago

Environment

Describe the bug

After HA starts, integration works fine. But became unavailable after a while due to it failed to retrive location data.

Traceback (most recent call last):
  File "/config/custom_components/gismeteo/api.py", line 198, in async_get_location
    xml = etree.fromstring(response)
  File "/usr/local/lib/python3.9/xml/etree/ElementTree.py", line 1347, in XML
    parser.feed(text)
xml.etree.ElementTree.ParseError: mismatched tag: line 6, column 2

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 313, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/gismeteo/__init__.py", line 116, in async_setup_entry
    coordinator = await _async_get_coordinator(hass, config_entry.entry_id, config)
  File "/config/custom_components/gismeteo/__init__.py", line 77, in _async_get_coordinator
    await gismeteo.async_get_location()
  File "/config/custom_components/gismeteo/api.py", line 207, in async_get_location
    raise ApiError(
custom_components.gismeteo.api.ApiError: Can't retrieve location data! Invalid server response.

Configuration.yaml No manual yaml configuration. Configured via integrations UI.

Steps to Reproduce

Expected behavior

Do not fail integration in case location is not available for a short period of time.

Debug log


Add your logs here.

Additional context

hudsonbrendon commented 2 years ago

Same error here.

alex-i-m commented 2 years ago

same problem - gismeteo 2.3.4, HA core 2021.11.5

wowgamr commented 2 years ago

The reason described here https://github.com/Limych/ha-gismeteo/issues/68#issuecomment-1004954268