skodaconnect / homeassistant-myskoda

Homeassistant integration for MySkoda.
96 stars 15 forks source link

Error setting up integration myskoda - received exception #13

Closed sonar98 closed 2 months ago

sonar98 commented 2 months ago

With the latest version I get an error when loading the custom integration. I think the nl.json file is not correct.


Logger: homeassistant.bootstrap
Bron: util/json.py:81
Eerst voorgekomen: 20:11:21 (1 gebeurtenissen)
Laatst gelogd: 20:11:21

Error setting up integration myskoda - received exception
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 75, in load_json
    return orjson.loads(fdesc.read())  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
orjson.JSONDecodeError: unexpected end of data: line 80 column 1 (char 1334)

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 185, in async_setup_component
    await future
  File "/usr/src/homeassistant/homeassistant/setup.py", line 185, in async_setup_component
    await future
  File "/usr/src/homeassistant/homeassistant/setup.py", line 165, in async_setup_component
    result = await _async_setup_component(hass, domain, config)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/setup.py", line 446, in _async_setup_component
    await load_translations_task
  File "/usr/src/homeassistant/homeassistant/helpers/translation.py", line 420, in async_load_integrations
    await _async_get_translations_cache(hass).async_load(
  File "/usr/src/homeassistant/homeassistant/helpers/translation.py", line 179, in async_load
    await self._async_load(language, components_to_load)
  File "/usr/src/homeassistant/homeassistant/helpers/translation.py", line 232, in _async_load
    translation_by_language_strings = await _async_get_component_strings(
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/translation.py", line 115, in _async_get_component_strings
    loaded_translations_by_language = await hass.async_add_executor_job(
                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/translation.py", line 59, in _load_translations_files_by_language
    loaded_json = load_json(translation_file)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/json.py", line 81, in load_json
    raise HomeAssistantError(f"Error while loading {filename}: {error}") from error
homeassistant.exceptions.HomeAssistantError: Error while loading /config/custom_components/myskoda/translations/nl.json: unexpected end of data: line 80 column 1 (char 1334)
Prior99 commented 2 months ago

Fixed by merging your PR. Thank you for the contribution!

Prior99 commented 2 months ago

(I will release this tomorrow)

WebSpider commented 2 months ago

Oh this was already merged? The PR was still draft because i had to test it. Woopz

Thanks for testing it for me 😜