mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-26 02:26:30 +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
|
# Run PulseAudio
|
||||||
with suppress(AudioError):
|
with suppress(AudioError):
|
||||||
if await self.instance.is_running():
|
if not await self.instance.is_running():
|
||||||
await self.restart()
|
|
||||||
else:
|
|
||||||
await self.start()
|
await self.start()
|
||||||
|
|
||||||
# Initialize Client Template
|
# Initialize Client Template
|
||||||
@ -137,8 +135,12 @@ class Audio(JsonConfig, CoreSysAttributes):
|
|||||||
|
|
||||||
async def restart(self) -> None:
|
async def restart(self) -> None:
|
||||||
"""Restart Audio plugin."""
|
"""Restart Audio plugin."""
|
||||||
with suppress(DockerAPIError):
|
_LOGGER.info("Restart Audio plugin")
|
||||||
|
try:
|
||||||
await self.instance.restart()
|
await self.instance.restart()
|
||||||
|
except DockerAPIError:
|
||||||
|
_LOGGER.error("Can't start Audio plugin")
|
||||||
|
raise AudioError() from None
|
||||||
|
|
||||||
async def start(self) -> None:
|
async def start(self) -> None:
|
||||||
"""Run CoreDNS."""
|
"""Run CoreDNS."""
|
||||||
|
@ -145,13 +145,13 @@ class Core(CoreSysAttributes):
|
|||||||
# Start observe the host Hardware
|
# Start observe the host Hardware
|
||||||
await self.sys_hwmonitor.load()
|
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")
|
_LOGGER.info("Supervisor is up and running")
|
||||||
self.state = CoreStates.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):
|
async def stop(self):
|
||||||
"""Stop a running orchestration."""
|
"""Stop a running orchestration."""
|
||||||
# don't process scheduler anymore
|
# don't process scheduler anymore
|
||||||
|
@ -116,6 +116,9 @@ class SoundControl(CoreSysAttributes):
|
|||||||
# Update input
|
# Update input
|
||||||
self._input.clear()
|
self._input.clear()
|
||||||
for source in pulse.source_list():
|
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(
|
self._input.append(
|
||||||
AudioProfile(
|
AudioProfile(
|
||||||
source.name,
|
source.name,
|
||||||
|
@ -133,7 +133,6 @@ class Hardware:
|
|||||||
def audio_devices(self) -> Dict[str, Any]:
|
def audio_devices(self) -> Dict[str, Any]:
|
||||||
"""Return all available audio interfaces."""
|
"""Return all available audio interfaces."""
|
||||||
if not ASOUND_CARDS.exists():
|
if not ASOUND_CARDS.exists():
|
||||||
_LOGGER.info("No audio devices found")
|
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user