Improve legacy integration

Hi,

I use the swiss_hydrological_data integration on a regular base.

Now that integration has been marked as a Legacy integration because its been around for a very long time and is only configurable using yaml.

I wan’t to improvbe the integration so that it meets at least the BRONZE level.

So now here comes the actual issue:

I’ve set up the dev environment and started to make changes to the files in homeassistant/components/swiss_hydrological_data but these changes do not seem to change anyrthing if I start HA.
If I click Add integration I get this error:

grafik

However if I copy the changed files into config/custom_components/swiss_hydrological_data I can configure the integration using the UI.

grafik

Is there a trick to make changes to a existing component?

Custom components get loaded completely dynamically. Built in components are “preregistered” in a list somewhere (I assume for performance reasons).

I think you need to run hassfest which will add your integration to that generated list .

You need to have config_flow=true in the manifest.json and also add the integration to the config_flows.py file in the homeassistant/generated directory. Running hassfest adds this if the key in manifest file is set.

python3 -m script.hassfest