From 4fe5d09f01ba9978148501e61ac263fe47dd7168 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sat, 29 Feb 2020 12:19:42 +0100 Subject: [PATCH 1/5] Bump version to 206 --- supervisor/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/const.py b/supervisor/const.py index 78109b5df..4fbc8d2e4 100644 --- a/supervisor/const.py +++ b/supervisor/const.py @@ -3,7 +3,7 @@ from enum import Enum from ipaddress import ip_network from pathlib import Path -SUPERVISOR_VERSION = "205" +SUPERVISOR_VERSION = "206" URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons" From 6d39b4d7cd0968b02116c820c5861dc241796c63 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Sat, 29 Feb 2020 19:28:52 +0100 Subject: [PATCH 2/5] Update audio.py (#1548) --- supervisor/api/audio.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/api/audio.py b/supervisor/api/audio.py index 80fde81d9..fa269a81c 100644 --- a/supervisor/api/audio.py +++ b/supervisor/api/audio.py @@ -163,7 +163,7 @@ class APIAudio(CoreSysAttributes): @api_process async def set_profile(self, request: web.Request) -> None: """Set audio default sources.""" - body = await api_validate(SCHEMA_DEFAULT, request) + body = await api_validate(SCHEMA_PROFILE, request) await asyncio.shield( self.sys_host.sound.set_profile(body[ATTR_CARD], body[ATTR_NAME]) From 3d555f951daf93041b3817053c4d8e83e64fa359 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sat, 29 Feb 2020 23:07:34 +0100 Subject: [PATCH 3/5] Fix supervisor update flow with apparmor (#1551) --- supervisor/host/apparmor.py | 2 +- supervisor/supervisor.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/supervisor/host/apparmor.py b/supervisor/host/apparmor.py index 5ce0e86ed..bd411b12d 100644 --- a/supervisor/host/apparmor.py +++ b/supervisor/host/apparmor.py @@ -73,7 +73,7 @@ class AppArmorControl(CoreSysAttributes): # Copy to AppArmor folder dest_profile = Path(self.sys_config.path_apparmor, profile_name) try: - shutil.copy(profile_file, dest_profile) + shutil.copyfile(profile_file, dest_profile) except OSError as err: _LOGGER.error("Can't copy %s: %s", profile_file, err) raise HostAppArmorError() from None diff --git a/supervisor/supervisor.py b/supervisor/supervisor.py index 0f4666649..ee5be07b1 100644 --- a/supervisor/supervisor.py +++ b/supervisor/supervisor.py @@ -115,7 +115,7 @@ class Supervisor(CoreSysAttributes): _LOGGER.info("Update Supervisor to version %s", version) try: - await self.instance.update(version, latest=True) + await self.instance.install(version, image=None, latest=True) except DockerAPIError: _LOGGER.error("Update of Supervisor fails!") raise SupervisorUpdateError() from None From 1c23e26f93d236ed7c674608d57945ba52251b84 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sat, 29 Feb 2020 23:45:37 +0100 Subject: [PATCH 4/5] Check if SND is loaded (#1552) * Check if SND is loaded * add warning --- supervisor/docker/audio.py | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/supervisor/docker/audio.py b/supervisor/docker/audio.py index a7c0e8654..520c1675a 100644 --- a/supervisor/docker/audio.py +++ b/supervisor/docker/audio.py @@ -1,6 +1,8 @@ """Audio docker object.""" from contextlib import suppress import logging +from pathlib import Path +from typing import Dict from ..const import ENV_TIME from ..coresys import CoreSysAttributes @@ -25,6 +27,22 @@ class DockerAudio(DockerInterface, CoreSysAttributes): """Return name of Docker container.""" return AUDIO_DOCKER_NAME + @property + def volumes(self) -> Dict[str, Dict[str, str]]: + """Return Volumes for the mount.""" + volumes = { + str(self.sys_config.path_extern_audio): {"bind": "/data", "mode": "rw"}, + "/etc/group": {"bind": "/host/group", "mode": "ro"}, + } + + # SND support + if Path("/dev/snd").exists(): + volumes.update({"/dev/snd": {"bind": "/dev/snd", "mode": "rw"}}) + else: + _LOGGER.warning("Kernel have no audio support in") + + return volumes + def _run(self) -> None: """Run Docker image. @@ -48,14 +66,7 @@ class DockerAudio(DockerInterface, CoreSysAttributes): detach=True, privileged=True, environment={ENV_TIME: self.sys_timezone}, - volumes={ - str(self.sys_config.path_extern_audio): { - "bind": "/data", - "mode": "rw", - }, - "/dev/snd": {"bind": "/dev/snd", "mode": "rw"}, - "/etc/group": {"bind": "/host/group", "mode": "ro"}, - }, + volumes=self.volumes, ) self._meta = docker_container.attrs From 2b41ffe0193694675171343cf2dcebd3cf1312a0 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sun, 1 Mar 2020 17:52:35 +0100 Subject: [PATCH 5/5] Bump version to 207 --- supervisor/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/const.py b/supervisor/const.py index 4fbc8d2e4..710b53bbe 100644 --- a/supervisor/const.py +++ b/supervisor/const.py @@ -3,7 +3,7 @@ from enum import Enum from ipaddress import ip_network from pathlib import Path -SUPERVISOR_VERSION = "206" +SUPERVISOR_VERSION = "207" URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons"