zxdavb / ramses_cc

HA integration for CH/DHW and HVAC systems that use the RAMSES II RF protocol
GNU General Public License v3.0
78 stars 17 forks source link

Config flow throws: KeyError: 'restore_cache' #137

Closed zxdavb closed 9 months ago

zxdavb commented 9 months ago

@trvrnrth With this configuration file:

ramses_cc:
  serial_port: /dev/serial/by-id/usb-SparkFun_evofw3_atmega32u4-if00

... I get this error:

2024-01-14 10:55:40.074 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved:   File "/home/dbonnes/clients/hass/venv/bin/hass", line 8, in <module>
    sys.exit(main())
  File "/home/dbonnes/clients/hass/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
...
Traceback (most recent call last):
  File "/home/dbonnes/clients/hass/homeassistant/config_entries.py", line 888, in async_init
    flow, result = await task
                   ^^^^^^^^^^
  File "/home/dbonnes/clients/hass/homeassistant/config_entries.py", line 916, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dbonnes/clients/hass/homeassistant/data_entry_flow.py", line 416, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dbonnes/clients/ramses_cc/custom_components/ramses_cc/config_flow.py", line 476, in async_step_import
    import_data.pop("restore_cache")
KeyError: 'restore_cache'

The system appears to start OK with:

ramses_cc:
  serial_port: /dev/serial/by-id/usb-SparkFun_evofw3_atmega32u4-if00
  restore_cache:
    restore_schema: true
    restore_state: true
zxdavb commented 9 months ago

We need tests.

trvrnrth commented 9 months ago

Should be fixed with 56e9ce04b6246a5cc5c0c56390825ca5ac26f0be