From 0790e6bc986b221ebe176c8316a5daea1c5f803f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hauke=20Z=C3=BChl?= Date: Tue, 22 Sep 2026 12:56:22 +0200 Subject: [PATCH] =?UTF-8?q?Optionaler=20Name=20f=C3=BCr=20eine=20Konfigura?= =?UTF-8?q?tion=20hinzugef=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/Muell/__init__.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/python/Muell/__init__.py b/python/Muell/__init__.py index eb4030c..8a4124d 100644 --- a/python/Muell/__init__.py +++ b/python/Muell/__init__.py @@ -62,6 +62,12 @@ class Muell: 'User-Agent': 'Mozilla/5.0 (Linux; x68_64; x64; rv:88.0) Gecko/20100101 Firefox/88.0', 'Content-Type': 'application/x-www-form-urlencoded', } + + try: + self.__name = self.__config['name'] + except KeyError: + self.__name = None + kommune = self.__config['kommune'] self.__csv = f'muell-{kommune}-{self.__current_year}.csv' @@ -176,7 +182,10 @@ class Muell: if len(tonnen) > 0: tonnen = ' und '.join(tonnen) - ausgabe = f'Morgen {wird} {tonnen} abgeholt' + if self.__name is not None: + ausgabe = f'{self.__name}: Morgen {wird} {tonnen} abgeholt' + else: + ausgabe = f'Morgen {wird} {tonnen} abgeholt' else: ausgabe = None