diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2023-06-14 14:06:26 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2023-06-19 23:19:35 +0300 |
commit | e97f98e5e27a6df3827564cce594f27f18c89267 (patch) | |
tree | 0490a13b5df2d9e1fe9d5d6039401b234be99b01 /include/py/homekit/audio | |
parent | 5d8e81b6c8fc7abe75188007c6a86bb501a314ad (diff) |
wip
Diffstat (limited to 'include/py/homekit/audio')
-rw-r--r-- | include/py/homekit/audio/amixer.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/include/py/homekit/audio/amixer.py b/include/py/homekit/audio/amixer.py index 5133c97..8ed754b 100644 --- a/include/py/homekit/audio/amixer.py +++ b/include/py/homekit/audio/amixer.py @@ -1,6 +1,6 @@ import subprocess -from ..config import app_config as config +from ..config import config from threading import Lock from typing import Union, List @@ -10,14 +10,14 @@ _default_step = 5 def has_control(s: str) -> bool: - for control in config['amixer']['controls']: + for control in config.app_config['amixer']['controls']: if control['name'] == s: return True return False def get_caps(s: str) -> List[str]: - for control in config['amixer']['controls']: + for control in config.app_config['amixer']['controls']: if control['name'] == s: return control['caps'] raise KeyError(f'control {s} not found') @@ -25,7 +25,7 @@ def get_caps(s: str) -> List[str]: def get_all() -> list: controls = [] - for control in config['amixer']['controls']: + for control in config.app_config['amixer']['controls']: controls.append({ 'name': control['name'], 'info': get(control['name']), @@ -55,8 +55,8 @@ def nocap(control): def _get_default_step() -> int: - if 'step' in config['amixer']: - return int(config['amixer']['step']) + if 'step' in config.app_config['amixer']: + return int(config.app_config['amixer']['step']) return _default_step @@ -75,7 +75,7 @@ def decr(control, step=None): def call(*args, return_code=False) -> Union[int, str]: with _lock: - result = subprocess.run([config['amixer']['bin'], *args], + result = subprocess.run([config.app_config['amixer']['bin'], *args], stdout=subprocess.PIPE, stderr=subprocess.PIPE) if return_code: |