mbillow / ha-chargepoint

Home Assistant ChargePoint EV Charger Integration
MIT License
48 stars 7 forks source link

Error setting up entry for chargepoint: `KeyError: 'zoomBounds'` #24

Closed PaarthShah closed 1 year ago

PaarthShah commented 1 year ago

This error originated from [this] custom integration.

Logger: homeassistant.config_entries Source: custom_components/chargepoint/init.py:107 Integration: ChargePoint (documentation, issues) First occurred: 2:02:57 PM (1 occurrences) Last logged: 2:02:57 PM

Error setting up entry <Name> for chargepoint
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 382, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/chargepoint/__init__.py", line 107, in async_setup_entry
    client: ChargePoint = await hass.async_add_executor_job(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.10/site-packages/python_chargepoint/client.py", line 78, in __init__
    self._global_config = self._get_configuration(username)
  File "/usr/local/lib/python3.10/site-packages/python_chargepoint/client.py", line 177, in _get_configuration
    config = ChargePointGlobalConfiguration.from_json(response.json())
  File "/usr/local/lib/python3.10/site-packages/python_chargepoint/global_config.py", line 116, in from_json
    supported_ctr = [
  File "/usr/local/lib/python3.10/site-packages/python_chargepoint/global_config.py", line 117, in <listcomp>
    ChargePointCountry.from_json(country)
  File "/usr/local/lib/python3.10/site-packages/python_chargepoint/global_config.py", line 45, in from_json
    zoom_bounds=ChargePointZoomBounds.from_json(json["zoomBounds"]),
KeyError: 'zoomBounds'
pbryan7 commented 1 year ago

Same thing happened to me today too... Updating to the latest version (v0.6.0) seems to have fixed it.

mbillow commented 1 year ago

Yup, this is the same as #24. Updating to v0.6.0 should fix your issue. 😄