3.0 fails to start with KeyError: 'flo' when configured through web UI
Closed this issue · 2 comments
After upgrading to the 3.0 release via. HACS and configuring via. the integration config rather than in configuration.yaml, the integration is failing to start on my system and throwing the error below in home_assistant.log.
If I remove the integration and put the configuration back in configuration.yaml, everything works. However, I have to define both a username
and email
key in the flo block to keep from getting an error in the logs.
Invalid config for [flo]: required key not provided @ data['flo']['username']. Got None. (See /config/configuration.yaml, line 257). Please check the docs at https://github.com/rsnodgrass/hass-flo-water/
I am running on the HassOS platform on a RPi 4, with verision 0.114.1 (freshly upgraded).
2020-08-15 22:13:46 ERROR (MainThread) [homeassistant.setup] Error during setup of component flo
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 191, in _async_setup_component
result = await task
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/flo/__init__.py", line 58, in setup
conf = config[FLO_DOMAIN]
KeyError: 'flo'
I've fixed username to be optional, instead of required. Just released a new version.
For now, I've disabled the config flow style configuration until I can figure out why the keys aren't being stored/loaded properly under the flo: domain.
Thanks for letting me know.
@rsnodgrass I hate to say this... I upgraded to 3.02 and it's broken in a different way, it doesn't run at all. Which is odd, as I see these constants defined in const.py in the custom component.
2020-08-16 10:55:21 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform flo.switch: Platform not found (cannot import name 'ICON_VALVE_OPEN' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)).
2020-08-16 10:55:21 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform flo.switch: Platform not found (cannot import name 'ICON_VALVE_OPEN' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py)).
2020-08-16 10:55:22 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform flo.sensor: Platform not found (cannot import name 'ICON_FLOW_RATE' from 'pyflowater.const' (/usr/local/lib/python3.8/site-packages/pyflowater/const.py)).
2020-08-16 10:55:22 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform flo.sensor: Platform not found (cannot import name 'ICON_FLOW_RATE' from 'pyflowater.const' (/usr/local/lib/python3.8/site-packages/pyflowater/const.py)).