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:
Christian
2018-11-19 12:05:12 +01:00
committed by Pascal Vizeli
parent b8818788c9
commit ec366d8112

View File

@@ -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,