I host HASS on Proxmox and so following the whole USB loading to gain ssh wasn’t a good method for me. Instead here’s how I did it
A small disclaimer here:
Proceed only if you know exactly what you’re doing. I will not be personally responsible or provide solutions if you break anything in HA and can’t revert your changes. There IS a good reason for keeping this out of reach in GUI.
In my case what I needed to do was clone an unreleased commit into the integration folder. I did it by uploading the file into custom_components and then moving it into the relevant integration folder.
The changed file was
__init__.py
I made a backup of the current one and copied the updated copy into the integration folder before restarting HA.
I totally understand, but it’s not for lack of trying. I have tried to place the integration in the custom_components folder but it wouldn’t load correctly whether it was the current branch or unreleased one.
In my case as described, it’s a small edit in init.py that fixed a big problem for me so well worth the effort. In weeks or months should a new HA release finally contain the fix, then these changes will get overwritten anyway as intended.
So what is the recommended way to override component files in components/media_source/local_source.py?
(I usually use SSH to edit line 189 in local_source.py to add , reverse=True so I can view my latest recordings first, since there are no default sorting options for local media.)
I tried using the method you seem to suggest above → I copied everything from components/media_source to /custom_components/media_source and added , “version”: “0.1” to the copied manifest.json, but even after a few restarts it doesn’t seem to want to work:
# Home Assistant Core
Setup failed for default_config: (DependencyError(...), 'Could not setup dependencies: media_source')
7:11:34 PM – (ERROR) setup.py
Unable to set up dependencies of default_config. Setup failed for dependencies: media_source
7:11:34 PM – (ERROR) setup.py
Setup failed for custom integration media_source: No setup or config entry setup function defined.
7:11:14 PM – (ERROR) setup.py
Any idea why that is or have a better suggestion about how to overwrite the settings in the components/media_source folder in a way that survives Home Assistant updates?