mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-24 09:36:31 +00:00
Adjust sound reload (#1531)
* Adjust sound reload & remove quirk * clean info message * fix hack
This commit is contained in:
parent
7e3859e2f5
commit
374bcf8073
@ -81,9 +81,7 @@ class Audio(JsonConfig, CoreSysAttributes):
|
||||
|
||||
# Run PulseAudio
|
||||
with suppress(AudioError):
|
||||
if await self.instance.is_running():
|
||||
await self.restart()
|
||||
else:
|
||||
if not await self.instance.is_running():
|
||||
await self.start()
|
||||
|
||||
# Initialize Client Template
|
||||
@ -137,8 +135,12 @@ class Audio(JsonConfig, CoreSysAttributes):
|
||||
|
||||
async def restart(self) -> None:
|
||||
"""Restart Audio plugin."""
|
||||
with suppress(DockerAPIError):
|
||||
_LOGGER.info("Restart Audio plugin")
|
||||
try:
|
||||
await self.instance.restart()
|
||||
except DockerAPIError:
|
||||
_LOGGER.error("Can't start Audio plugin")
|
||||
raise AudioError() from None
|
||||
|
||||
async def start(self) -> None:
|
||||
"""Run CoreDNS."""
|
||||
|
@ -145,13 +145,13 @@ class Core(CoreSysAttributes):
|
||||
# Start observe the host Hardware
|
||||
await self.sys_hwmonitor.load()
|
||||
|
||||
# Upate Host/Deivce information
|
||||
self.sys_create_task(self.sys_host.reload())
|
||||
self.sys_create_task(self.sys_updater.reload())
|
||||
|
||||
_LOGGER.info("Supervisor is up and running")
|
||||
self.state = CoreStates.RUNNING
|
||||
|
||||
# On full host boot, relaod information
|
||||
self.sys_create_task(self.sys_host.reload())
|
||||
self.sys_create_task(self.sys_updater.reload())
|
||||
|
||||
async def stop(self):
|
||||
"""Stop a running orchestration."""
|
||||
# don't process scheduler anymore
|
||||
|
@ -116,6 +116,9 @@ class SoundControl(CoreSysAttributes):
|
||||
# Update input
|
||||
self._input.clear()
|
||||
for source in pulse.source_list():
|
||||
# Filter monitor devices out because we did not use it now
|
||||
if source.name.endswith(".monitor"):
|
||||
continue
|
||||
self._input.append(
|
||||
AudioProfile(
|
||||
source.name,
|
||||
|
@ -133,7 +133,6 @@ class Hardware:
|
||||
def audio_devices(self) -> Dict[str, Any]:
|
||||
"""Return all available audio interfaces."""
|
||||
if not ASOUND_CARDS.exists():
|
||||
_LOGGER.info("No audio devices found")
|
||||
return {}
|
||||
|
||||
try:
|
||||
|
Loading…
x
Reference in New Issue
Block a user