mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-09 10:16:29 +00:00
rename audio object
This commit is contained in:
parent
3382688669
commit
0cca8f522b
@ -376,7 +376,7 @@ class Addon(CoreSysAttributes):
|
||||
if self.is_installed and \
|
||||
ATTR_AUDIO_OUTPUT in self._data.user[self._id]:
|
||||
return self._data.user[self._id][ATTR_AUDIO_OUTPUT]
|
||||
return self._audio.default.output
|
||||
return self._alsa.default.output
|
||||
|
||||
@audio_output.setter
|
||||
def audio_output(self, value):
|
||||
@ -394,7 +394,7 @@ class Addon(CoreSysAttributes):
|
||||
|
||||
if self.is_installed and ATTR_AUDIO_INPUT in self._data.user[self._id]:
|
||||
return self._data.user[self._id][ATTR_AUDIO_INPUT]
|
||||
return self._audio.default.input
|
||||
return self._alsa.default.input
|
||||
|
||||
@audio_input.setter
|
||||
def audio_input(self, value):
|
||||
@ -537,7 +537,7 @@ class Addon(CoreSysAttributes):
|
||||
|
||||
def write_asound(self):
|
||||
"""Write asound config to file and return True on success."""
|
||||
asound_config = self._audio.asound(
|
||||
asound_config = self._alsa.asound(
|
||||
alsa_input=self.audio_input, alsa_output=self.audio_output)
|
||||
|
||||
try:
|
||||
|
@ -28,7 +28,7 @@ class APIHardware(CoreSysAttributes):
|
||||
"""Show ALSA audio devices."""
|
||||
return {
|
||||
ATTR_AUDIO: {
|
||||
ATTR_INPUT: self._audio.input_devices,
|
||||
ATTR_OUTPUT: self._audio.output_devices,
|
||||
ATTR_INPUT: self._alsa.input_devices,
|
||||
ATTR_OUTPUT: self._alsa.output_devices,
|
||||
}
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ class CoreSys(object):
|
||||
self._snapshots = None
|
||||
self._tasks = None
|
||||
self._services = None
|
||||
self._audio = None
|
||||
self._alsa = None
|
||||
|
||||
@property
|
||||
def arch(self):
|
||||
@ -205,16 +205,16 @@ class CoreSys(object):
|
||||
self._services = value
|
||||
|
||||
@property
|
||||
def audio(self):
|
||||
def alsa(self):
|
||||
"""Return ALSA Audio object."""
|
||||
return self._audio
|
||||
return self._alsa
|
||||
|
||||
@audio.setter
|
||||
def audio(self, value):
|
||||
@alsa.setter
|
||||
def alsa(self, value):
|
||||
"""Set a ALSA Audio object."""
|
||||
if self._audio:
|
||||
raise RuntimeError("Audio already set!")
|
||||
self._audio = value
|
||||
if self._alsa:
|
||||
raise RuntimeError("ALSA already set!")
|
||||
self._alsa = value
|
||||
|
||||
|
||||
class CoreSysAttributes(object):
|
||||
|
Loading…
x
Reference in New Issue
Block a user