mampfes / hacs_waste_collection_schedule

Home Assistant integration framework for (garbage collection) schedules
MIT License
976 stars 627 forks source link

[Bug]: 2.0.0 update breaks all WCS integrations / UI based config not possible #2303

Closed bcutter closed 1 month ago

bcutter commented 1 month ago

I Have A Problem With:

The integration in general

What's Your Problem

After updating from 1.49.0 to 2.0.0 and restarting HA, all sensors (calendars etc.) became unavailable.

YAML configuration still exists unchanged, there was no automatic transformation to the UI based configuration.

This is what the logs refer to: grafik

It's not possible to add the integration using the UI. Trying to do so gives:

grafik

(translated "The configuration flow could not be loaded: {“message”: “Invalid handler specified”}")

I'll try to downgrade now to 1.49.0 until this is resolved.

Source (if relevant)

ics

Logs

1)

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: homeassistant.config
Source: custom_components/waste_collection_schedule/init_ui.py:11
Integration: Waste Collection Schedule (documentation)
First occurred: 17:58:59 (18 occurrences)
Last logged: 17:58:59

Platform error: sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config.py", line 928, in async_process_component_config
    platform = p_integration.get_platform(domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 779, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 796, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 992, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/waste_collection_schedule/__init__.py", line 3, in <module>
    from .init_ui import async_setup_entry, async_update_listener, async_unload_entry, async_migrate_entry
  File "/config/custom_components/waste_collection_schedule/init_ui.py", line 11, in <module>
    from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
ImportError: cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)

2)

Logger: homeassistant.config
Source: config.py:410
First occurred: 17:59:04 (1 occurrences)
Last logged: 17:59:04

Package waste setup failed. Integration waste_collection_schedule cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py) (See /config/integrations/waste.yaml:37).

3)

Logger: homeassistant.config_entries
Source: config_entries.py:858
First occurred: 18:08:24 (1 occurrences)
Last logged: 18:08:24

Error occurred loading flow for integration waste_collection_schedule: cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)

Relevant Configuration

No response

Checklist Source Error

Checklist Sensor Error

Required

5ila5 commented 1 month ago

Do you run a HA older than 2023.9.0? It might not be compatible with 2023.8.X or older.

bcutter commented 1 month ago

Yes. That's not stated properly as already mentioned:

  • Maybe the 2.0.0 integration needs a minimum HA Core version?

  • Unfortunately, the hacs.json does not specify a minimum HA version.

5ila5 commented 1 month ago

I did some testing, and it looks like for everything since 2023.9.0 the integration works, but only the yaml configuration and the config flow fails. The config flow works for everything since 2023.12.0. I added this as minimum version to the hacs.json and released 2.0.1 with this minimum version. I set 2.0.0 as pre-release, so HA should not offer this release unless you explicitly activate to allow beta releases while installing

bcutter commented 1 month ago

I can confirm with HA 2023.12 or newer the v2.0.1 works just fine in terms of:

Anyway, somehow when reading the UI support of v2.0 I expected that the YAML configuration is migrated to the UI. Therefore I was surprised to (still) not having a WCS integration in /config/integrations/dashboard.

I guess you could close this issue, but maybe also elaborate a bit on how you plan to give existing users a benefit of the UI. Configuring everything (working for years!) from scratch (in the UI by then removing the YAML code) is not very attractive. For new users of course, the UI config option is super attractive as it lowers the entry barriers with the configuration complexity massively.

5ila5 commented 1 month ago

I don't think there are currently any plans on "migrating" YAML configuration to GUI configurations, I don't even know if this even possible as GUI setups and YAML configs are treated quite differently, We could add a YAML import dialogue I don't even think it would be that much work, but I honestly don't know how many people would use this anyway

bcutter commented 1 month ago

Well that's the usual way - at least for core/official integrations: once UI config flow has been implemented, YAML configuration (in cases where the UI offers the very same config options!) is automatically imported and deprecated for a few months, after that time it is invalidated so only the UI configured part is working.

I bet more people than we think would like to see something in their integrations dashboard 😁

grafik

Feature request submitted this way (?) 😃

5ila5 commented 1 month ago

Feel free to open a feature request. I will look into it but it does not have the highest priority atm