jmcollin78 / solar_optimizer

The Solar Optimizer integration for Home Assistant starts and stops your equipments depending on the Solar net production
MIT License
53 stars 10 forks source link

'NoneType' object has no attribute 'get' #31

Closed jms92100 closed 1 month ago

jms92100 commented 1 month ago

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'
jmcollin78 commented 1 month ago

Hello,

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

jms92100 commented 1 month ago

Thanks for your answer. I finally went through your solar optimizer integration . (I had not created the yaml file, thought that the integration had to be run before)

Le lun. 13 mai 2024 à 07:20, Jean-Marc Collin @.***> a écrit :

Hello,

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

— Reply to this email directly, view it on GitHub https://github.com/jmcollin78/solar_optimizer/issues/31#issuecomment-2106676442, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG5WRE6OM7UZ7IKTHN33SILZCBERFAVCNFSM6AAAAABHR6CYOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBWGY3TMNBUGI . You are receiving this because you authored the thread.Message ID: @.***>

-- Cordialement