-
Notifications
You must be signed in to change notification settings - Fork 694
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add-on translations also for environment vars when creating own Add-on #5739
Comments
So I get what youre trying to do with the I'm not understanding your add-on translation use case though. Add-on translations are used for providing language specific translations to the static documentation around options and such. Why would you need to substitute user-entered data in? Btw if you are comfortable in python you're welcome to submit a PR for one or both of these. I can review and help get it in. |
I assumed that using translations would be the key for injecting values from UI to environment (like it happens with options).
Like I tried in the Redis Add-on, they offer the possibility for defining arguments for multiple components, here is the doc. So, that means I would like offering to end user a way for injecting these values. Another example where triggered me the need for opening this request is So, that being said, I try finding a way to inject values from UI to envs when the container is deployed. Do you try to say that I could implement support for this in python? I am okay with that if you could guide me a little how I can prepare a developing env, maybe some docs / links. |
Just to clarify, when you say "translations" then you mean these right? The JSON files you put in a folder called Or at least Supervisor doesn't, as an addon developer you're obviously welcome to include whatever you want in the published image for your addon. But Supervisor will not do anything to make these translations available in the container at runtime. It believes the only consumer is the Home Assistant frontend, not the addon itself.
Yea this all makes sense to me. Currently we expect add-on developers to make their own images for add-ons and use scripts that run at start of the container to map add-on options into envs if that is what is needed. You can see a rudimentary example of how this works in the example add-on here But your idea of referencing options in envs defined in
We do have a guide for getting started on Supervisor development here. It's not too different then core development except a much smaller code base with much less throughput in terms of PRs. You'd probably want to look at this and this. The first is Supervisor's object representing an addon you have installed, the second is an object representing how an installed addon is translated into a Docker container. |
Describe the issue you are experiencing
Hi team,
I am writing you about a feature request. I am sorry that I use the issue form for asking a feature request, but it passed more than 1 month since I wrote on Community Forum, here is the link, and until now I haven't received an answer.
I am asking a way to pass values of environment variables through UI for an Add-on like we can do for options.
Here is my description wrote on community:
I have started to create my own several Add-ons but without building the docker image. I preferred to have an Add-on like you would deploy a docker container: a base image from docker io, mapping some dirs for persistency, bind tcp ports and passing several environments.
All of these could be made according to Add-on Configuration documentation (with a small mention regarding to binding dirs by using
map
, but that would be another discussion).I started to need a way to pass values for environmemt variables from UI like it can be made for Options / Schema along with Add-on translations. I understand that this mechanism is created to pass options as variables inside the container and to be read with
bashio
module into an entrypoint script, but in my case I don't want to mess with building a new image as long as I can find a good enough image on docker io.For example, here I already tried to pass somehow the options values to environment for my
redis-stack
Add-on. It ends up without interpreting the yaml, therefore my envs won't have the values of options, just a plain text like it appears starting with line36
.Maybe this can be made already and I didn't find yet how to do that. Could you guide me, guys ?
To be honest, that would be a nice feature if it doesn't exist yet.
What type of installation are you running?
Home Assistant OS
Which operating system are you running on?
Home Assistant Operating System
Steps to reproduce the issue
There isn't a problem.
Anything in the Supervisor logs that might be useful for us?
System information
System Information
Home Assistant Community Store
Home Assistant Cloud
Home Assistant Supervisor
Dashboards
Recorder
Sonoff
Supervisor diagnostics
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: