diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2023-06-10 21:54:56 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2023-06-10 21:55:01 +0300 |
commit | 327a5298359027099631c3c9967b7585928cd367 (patch) | |
tree | fb6358ceb3182c285bce3cff392654b0538c2c5c /src/home/telegram/config.py | |
parent | f29e139cbb7e4a4d539cba6e894ef4a6acd312d6 (diff) |
port relay_mqtt_http_proxy to new config scheme; config: support addr types & normalization
Diffstat (limited to 'src/home/telegram/config.py')
-rw-r--r-- | src/home/telegram/config.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/home/telegram/config.py b/src/home/telegram/config.py index 7a46087..4c7d74b 100644 --- a/src/home/telegram/config.py +++ b/src/home/telegram/config.py @@ -12,8 +12,8 @@ class TelegramUserListType(Enum): class TelegramUserIdsConfig(ConfigUnit): NAME = 'telegram_user_ids' - @staticmethod - def schema() -> Optional[dict]: + @classmethod + def schema(cls) -> Optional[dict]: return { 'roottype': 'dict', 'type': 'integer' @@ -32,8 +32,8 @@ def _user_id_mapper(user: Union[str, int]) -> int: class TelegramChatsConfig(ConfigUnit): NAME = 'telegram_chats' - @staticmethod - def schema() -> Optional[dict]: + @classmethod + def schema(cls) -> Optional[dict]: return { 'type': 'dict', 'schema': { @@ -44,8 +44,8 @@ class TelegramChatsConfig(ConfigUnit): class TelegramBotConfig(ConfigUnit, ABC): - @staticmethod - def schema() -> Optional[dict]: + @classmethod + def schema(cls) -> Optional[dict]: return { 'bot': { 'type': 'dict', |