summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/home/audio/amixer.py2
-rw-r--r--src/home/config/__init__.py1
-rw-r--r--src/home/config/config.py16
-rw-r--r--src/home/database/clickhouse.py2
-rwxr-xr-xsrc/inverter_mqtt_util.py2
5 files changed, 3 insertions, 20 deletions
diff --git a/src/home/audio/amixer.py b/src/home/audio/amixer.py
index 53e6bce..5133c97 100644
--- a/src/home/audio/amixer.py
+++ b/src/home/audio/amixer.py
@@ -1,6 +1,6 @@
import subprocess
-from ..config import config
+from ..config import app_config as config
from threading import Lock
from typing import Union, List
diff --git a/src/home/config/__init__.py b/src/home/config/__init__.py
index 2b338d5..03b9f25 100644
--- a/src/home/config/__init__.py
+++ b/src/home/config/__init__.py
@@ -7,7 +7,6 @@ from .config import (
setup_logging,
app_config
)
-from .validators import validate
from ._configs import (
LinuxBoardsConfig,
ServicesListConfig
diff --git a/src/home/config/config.py b/src/home/config/config.py
index 5305039..e1a089d 100644
--- a/src/home/config/config.py
+++ b/src/home/config/config.py
@@ -9,7 +9,6 @@ from typing import Optional, Any, MutableMapping, Union
from argparse import ArgumentParser
from enum import Enum, auto
from os.path import join, isdir, isfile
-from . import validators
from ..util import parse_addr
@@ -19,21 +18,6 @@ class RootSchemaType(Enum):
LIST = auto()
-_my_validators = {}
-
-
-def _get_validator(name: str) -> Optional[callable]:
- if hasattr(validators, f'{name}_validator'):
- return getattr(validators, f'{name}_validator')
- if name in _my_validators:
- return _my_validators[name]
- return None
-
-
-def add_validator(name: str, f: callable):
- _my_validators[name] = f
-
-
class ConfigUnit:
NAME = 'dumb'
diff --git a/src/home/database/clickhouse.py b/src/home/database/clickhouse.py
index ca81628..d0ec283 100644
--- a/src/home/database/clickhouse.py
+++ b/src/home/database/clickhouse.py
@@ -1,7 +1,7 @@
import logging
from zoneinfo import ZoneInfo
-from datetime import datetime, timedelta
+from datetime import datetime
from clickhouse_driver import Client as ClickhouseClient
from ..config import is_development_mode
diff --git a/src/inverter_mqtt_util.py b/src/inverter_mqtt_util.py
index bfa9af7..791bf80 100755
--- a/src/inverter_mqtt_util.py
+++ b/src/inverter_mqtt_util.py
@@ -13,7 +13,7 @@ if __name__ == '__main__':
mode = arg.mode[0]
mqtt = MqttWrapper(client_id=f'inverter_mqtt_{mode}',
- clean_session=arg.mode[0] != 'receiver')
+ clean_session=mode != 'receiver')
node = MqttNode(node_id='inverter')
module_kwargs = {}
if mode == 'sender':