Reload custom_component?

Can custom_components be reloaded without a full restart?

Any tips for quickly iterating on code?

Maybe a way to run python snippets or access an interactive python shell?

You could make your custom component register a service, that makes it redo the initialization.

I am a newbie myself, so maybe there’s a better option.

I tried a service that re-registered itself but I am pretty sure I’d need to reload the code from disk

def setup(hass, config):
    ... snip ...

    def handle_register(call):, 'hello', handle_hello), 'register', handle_register)

Has anyone been able to figure out something that works?

I’ve tried reloading the component using the config flow reload function, but it seems to cache the files in disk and does not pull new changes to files.