Closed aviadlevy closed 7 months ago
Sound good. I'll look into it
@aviadlevy - give a try with 0.1.21
@GuyKh , thanks for the quick implementation.
Seems like something is broken :/
Logger: homeassistant.config_entries
Source: config_entries.py:406
First occurred: 17:02:02 (2 occurrences)
Last logged: 17:04:05
Error setting up entry IMS Weather for ims
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 406, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ims/__init__.py", line 53, in async_setup_entry
conditions = _get_config_value(entry, CONF_MONITORED_CONDITIONS)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/ims/__init__.py", line 148, in _get_config_value
return config_entry.data[key]
~~~~~~~~~~~~~~~~~^^^^^
KeyError: 'monitored_conditions'
I guess it wasn't backward compatibly.
My suggestion is revert current implementation and test new version on beta release (if such exists)
P.S.
Another thing I noticed is the default behaviour is changed. instead of having all the conditions as the default behaviour when no condition is checked, you have empty list here: https://github.com/t0mer/ims-custom-component/blob/a852d133562128d46f2b53170790702c4f34f70a/custom_components/ims/config_flow.py#L71
Good feedback. Will check
I now noticed that I can use Configure
here:
After choosing conditions there, my integration loaded as expected (unfortunately that mean I won't be able to test what might will fix the issue without doing that)
Also, try to remove and add. It should work
Also, try to remove and add. It should work
This was the best solution for me after all, since configuring existing configuration didn't auto remove unselected entities (I guess due to home assistant limitation preventing integration to remove entity)
Should be fixed with 0.1.22
Not everyone needs all entities. You can let the user to select which entity to add.
If you think it's a good idea, I'm willing to try and implement it (but it'll probably will take time)
Inspired from PiratWeather Hacs integration