From 32ab49b5663dc8635689a76c2e57dc536c3d2afc Mon Sep 17 00:00:00 2001 From: Stefan Allius Date: Sun, 14 Apr 2024 12:22:25 +0200 Subject: [PATCH] make depency check in reg_clr_at_midnight optional --- app/src/infos.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/infos.py b/app/src/infos.py index 5fa0697..595e8a7 100644 --- a/app/src/infos.py +++ b/app/src/infos.py @@ -497,7 +497,8 @@ class Infos: keys = row['name'] self.update_db(keys, False, value) - def reg_clr_at_midnight(self, prfx: str) -> None: + def reg_clr_at_midnight(self, prfx: str, + check_dependencies: bool = True) -> None: '''register all registers for the 'ClrAtMidnight' class and check if device of every register is available otherwise ignore the register. @@ -505,7 +506,7 @@ class Infos: prfx:str ==> prefix for the home assistant 'stat_t string'' ''' for id, row in self.info_defs.items(): - if 'ha' in row: + if check_dependencies and 'ha' in row: ha = row['ha'] if 'dev' in ha: device = self.info_devs[ha['dev']]