From 6bde527f5c3fa67b2c527e4e400cc87fd878a5c0 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Wed, 4 Mar 2020 19:09:20 +0100 Subject: [PATCH 1/4] Bump version to 209 --- supervisor/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/supervisor/const.py b/supervisor/const.py index 3f36e54ff..efb0d6810 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 = "208" +SUPERVISOR_VERSION = "209" URL_HASSIO_ADDONS = "https://github.com/home-assistant/hassio-addons" From 89148f8fffd60ca754e8aa8d9f5150460c47797a Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 5 Mar 2020 13:44:10 +0100 Subject: [PATCH 2/4] Bump packaging from 20.1 to 20.3 (#1570) Bumps [packaging](https://github.com/pypa/packaging) from 20.1 to 20.3. - [Release notes](https://github.com/pypa/packaging/releases) - [Changelog](https://github.com/pypa/packaging/blob/master/CHANGELOG.rst) - [Commits](https://github.com/pypa/packaging/compare/20.1...20.3) Signed-off-by: dependabot-preview[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8240faf3f..149bad24f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,7 +8,7 @@ cryptography==2.8 docker==4.2.0 gitpython==3.1.0 jinja2==2.11.1 -packaging==20.1 +packaging==20.3 ptvsd==4.3.2 pulsectl==20.2.4 pytz==2019.3 From 02aed9c0846cfdc776694549434ef8dfa6e46bff Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 5 Mar 2020 15:54:23 +0100 Subject: [PATCH 3/4] Enforce Pulse client (#1572) --- supervisor/homeassistant.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/supervisor/homeassistant.py b/supervisor/homeassistant.py index 2f44e663f..d338127fb 100644 --- a/supervisor/homeassistant.py +++ b/supervisor/homeassistant.py @@ -649,6 +649,5 @@ class HomeAssistant(JsonConfig, CoreSysAttributes): config_file.write(pulse_config) except OSError as err: _LOGGER.error("Home Assistant can't write pulse/client.config: %s", err) - raise HomeAssistantError() - - _LOGGER.debug("Home Assistant write pulse/client.config: %s", self.path_pulse) + else: + _LOGGER.info("Update pulse/client.config: %s", self.path_pulse) From 73e88750181d1865519df59b0980cad87f9b071b Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Fri, 6 Mar 2020 12:32:29 +0100 Subject: [PATCH 4/4] Fix Issue with pulse folder (#1573) * Fix Issue with pulse folder * Fix config check --- supervisor/addons/addon.py | 14 +++++++++----- supervisor/docker/homeassistant.py | 12 +++++++++++- supervisor/homeassistant.py | 10 ++++++++-- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/supervisor/addons/addon.py b/supervisor/addons/addon.py index 03a2ba3b0..80a4efbb7 100644 --- a/supervisor/addons/addon.py +++ b/supervisor/addons/addon.py @@ -393,6 +393,11 @@ class Addon(AddonModel): input_profile=self.audio_input, output_profile=self.audio_output ) + # Cleanup wrong maps + if self.path_pulse.is_dir(): + shutil.rmtree(self.path_pulse, ignore_errors=True) + + # Write pulse config try: with self.path_pulse.open("w") as config_file: config_file.write(pulse_config) @@ -400,11 +405,10 @@ class Addon(AddonModel): _LOGGER.error( "Add-on %s can't write pulse/client.config: %s", self.slug, err ) - raise AddonsError() - - _LOGGER.debug( - "Add-on %s write pulse/client.config: %s", self.slug, self.path_pulse - ) + else: + _LOGGER.debug( + "Add-on %s write pulse/client.config: %s", self.slug, self.path_pulse + ) async def install_apparmor(self) -> None: """Install or Update AppArmor profile for Add-on.""" diff --git a/supervisor/docker/homeassistant.py b/supervisor/docker/homeassistant.py index b5d55f100..3e0eb2c89 100644 --- a/supervisor/docker/homeassistant.py +++ b/supervisor/docker/homeassistant.py @@ -135,7 +135,17 @@ class DockerHomeAssistant(DockerInterface): detach=True, stdout=True, stderr=True, - volumes=self.volumes, + volumes={ + str(self.sys_config.path_extern_homeassistant): { + "bind": "/config", + "mode": "rw", + }, + str(self.sys_config.path_extern_ssl): {"bind": "/ssl", "mode": "ro"}, + str(self.sys_config.path_extern_share): { + "bind": "/share", + "mode": "ro", + }, + }, environment={ENV_TIME: self.sys_timezone}, ) diff --git a/supervisor/homeassistant.py b/supervisor/homeassistant.py index d338127fb..fae77c2b1 100644 --- a/supervisor/homeassistant.py +++ b/supervisor/homeassistant.py @@ -8,6 +8,7 @@ import os from pathlib import Path import re import secrets +import shutil import time from typing import Any, AsyncContextManager, Awaitable, Dict, Optional from uuid import UUID @@ -237,12 +238,12 @@ class HomeAssistant(JsonConfig, CoreSysAttributes): @property def path_pulse(self): """Return path to asound config.""" - return Path(self.sys_config.path_tmp, f"homeassistant_pulse") + return Path(self.sys_config.path_tmp, "homeassistant_pulse") @property def path_extern_pulse(self): """Return path to asound config for Docker.""" - return Path(self.sys_config.path_extern_tmp, f"homeassistant_pulse") + return Path(self.sys_config.path_extern_tmp, "homeassistant_pulse") @property def audio_output(self) -> Optional[str]: @@ -644,6 +645,11 @@ class HomeAssistant(JsonConfig, CoreSysAttributes): input_profile=self.audio_input, output_profile=self.audio_output ) + # Cleanup wrong maps + if self.path_pulse.is_dir(): + shutil.rmtree(self.path_pulse, ignore_errors=True) + + # Write pulse config try: with self.path_pulse.open("w") as config_file: config_file.write(pulse_config)