flobz / psacc-ha

psa_car_controller addons for Home Assistant
GNU General Public License v3.0
50 stars 46 forks source link

Allow access to config files & database via addon_config #45

Open waako opened 6 months ago

waako commented 6 months ago

According to Home Assistant add-on configuration docs:

[…] if your addon wants to provide file-based output or give users access to internal files […] […] you should add addon_config:rw to map so your addon can write to this folder as well as read from it. And then you should write these files out to /config during your addon's runtime so users can see and access them.

I understand how the issues with changing config.ini raised in #639 were resolved by making them changeable via API, but as far as I could tell still no longer possible to set weathermap API key, or backup database easily.

Sounds like it should be straightforward to add

"map": [
    "addon_config:rw"
 ],

and update PSACC_CONFIG_DIR environment variable to point to /config (therefore matching the docker image setup)

That should mean that all config files (config.ini, config.json), and database would be available by SSH to home assistant host and looking in /addon_configs/b9f12d83_psacc directory