From dfd1beb23899525b05bba7e11576a93cb1cee2fa Mon Sep 17 00:00:00 2001 From: HgO Date: Sun, 11 Aug 2024 09:42:32 +0200 Subject: [PATCH] rename config property user_id to select_values --- config.sample.yaml | 2 +- matrix_alertbot/config.py | 4 ++-- tests/resources/config/config.full.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config.sample.yaml b/config.sample.yaml index f8efecb..3982a07 100644 --- a/config.sample.yaml +++ b/config.sample.yaml @@ -46,7 +46,7 @@ dm: room_title: Alerts for {user} users: - matrix_id: "@user:matrix.example.com" - user_id: + select_values: - ec76b3e6-b49c-46c3-bd35-a329eaeafc4c webhook: diff --git a/matrix_alertbot/config.py b/matrix_alertbot/config.py index 3186743..94ca196 100644 --- a/matrix_alertbot/config.py +++ b/matrix_alertbot/config.py @@ -222,8 +222,8 @@ class Config: self.dm_users: BiDict[str, str] = BiDict() for user in self._get_cfg(["dm", "users"], default=[]): - for user_id in user["user_id"]: - self.dm_users[user_id] = user["matrix_id"] + for select_value in user["select_values"]: + self.dm_users[select_value] = user["matrix_id"] self.dm_room_title: str = self._get_cfg(["dm", "room_title"], required=False) filter_labels: Dict[str, str] = self._get_cfg( diff --git a/tests/resources/config/config.full.yml b/tests/resources/config/config.full.yml index 96a4e82..f52ecae 100644 --- a/tests/resources/config/config.full.yml +++ b/tests/resources/config/config.full.yml @@ -78,10 +78,10 @@ dm: room_title: Alerts for {user} users: - matrix_id: "@some_other_user1:example.com" - user_id: + select_values: - a7b37c33-574c-45ac-bb07-a3b314c2da54 - matrix_id: "@some_other_user2:example.com" - user_id: + select_values: - cfb32a1d-737a-4618-8ee9-09b254d98fee - 27e73f9b-b40a-4d84-b5b5-225931f6c289 cache: