mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-11-09 10:59:43 +00:00
Provide options for legacy add-ons (#814)
* Provide options for legacy add-ons * Remove whitespace from blank line * Only provide primitive data types as Docker environment variable * Fix linting issues * Update addon.py
This commit is contained in:
@@ -81,12 +81,14 @@ class DockerAddon(DockerInterface):
|
|||||||
"""Return environment for Docker add-on."""
|
"""Return environment for Docker add-on."""
|
||||||
addon_env = self.addon.environment or {}
|
addon_env = self.addon.environment or {}
|
||||||
|
|
||||||
# Need audio settings
|
# Provide options for legacy add-ons
|
||||||
if self.addon.with_audio:
|
if self.addon.legacy:
|
||||||
addon_env.update({
|
for key, value in self.addon.options.items():
|
||||||
'ALSA_OUTPUT': self.addon.audio_output,
|
if isinstance(value, (int, str)):
|
||||||
'ALSA_INPUT': self.addon.audio_input,
|
addon_env[key] = value
|
||||||
})
|
else:
|
||||||
|
_LOGGER.warning(
|
||||||
|
"Can not set nested option %s as Docker env", key)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
**addon_env,
|
**addon_env,
|
||||||
|
|||||||
Reference in New Issue
Block a user