jmcollin78/solar_optimizer

'NoneType' object has no attribute 'get'

Closed this issue · 2 comments

Version of the custom_component

Configuration

config not used for the moment 

Add your logs here.
Enregistreur: homeassistant.setup
Source: setup.py:404
S'est produit pour la première fois: 10:12:28 (1 occurrences)
Dernier enregistrement: 10:12:28

Error during setup of component solar_optimizer
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 404, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/solar_optimizer/__init__.py", line 97, in async_setup
    hass.data[DOMAIN]["coordinator"] = coordinator = SolarOptimizerCoordinator(
                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/solar_optimizer/coordinator.py", line 64, in __init__
    raise err
  File "/config/custom_components/solar_optimizer/coordinator.py", line 56, in __init__
    for _, device in enumerate(config.get("devices")):
                               ^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

Describe the bug

A clear and concise description of what the bug is.

impossible to get the plugin work

Debug log

done before


Add your logs here.
Enregistreur: homeassistant.setup
Source: setup.py:404
S'est produit pour la première fois: 10:12:28 (1 occurrences)
Dernier enregistrement: 10:12:28

Error during setup of component solar_optimizer
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 404, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/solar_optimizer/__init__.py", line 97, in async_setup
    hass.data[DOMAIN]["coordinator"] = coordinator = SolarOptimizerCoordinator(
                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/solar_optimizer/coordinator.py", line 64, in __init__
    raise err
  File "/config/custom_components/solar_optimizer/coordinator.py", line 56, in __init__
    for _, device in enumerate(config.get("devices")):
                               ^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'get'

Hello,

Your configuration is not good. Please add a configuration or deactivate the integration.