make depency check in reg_clr_at_midnight optional
This commit is contained in:
@@ -497,7 +497,8 @@ class Infos:
|
|||||||
keys = row['name']
|
keys = row['name']
|
||||||
self.update_db(keys, False, value)
|
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
|
'''register all registers for the 'ClrAtMidnight' class and
|
||||||
check if device of every register is available otherwise ignore
|
check if device of every register is available otherwise ignore
|
||||||
the register.
|
the register.
|
||||||
@@ -505,7 +506,7 @@ class Infos:
|
|||||||
prfx:str ==> prefix for the home assistant 'stat_t string''
|
prfx:str ==> prefix for the home assistant 'stat_t string''
|
||||||
'''
|
'''
|
||||||
for id, row in self.info_defs.items():
|
for id, row in self.info_defs.items():
|
||||||
if 'ha' in row:
|
if check_dependencies and 'ha' in row:
|
||||||
ha = row['ha']
|
ha = row['ha']
|
||||||
if 'dev' in ha:
|
if 'dev' in ha:
|
||||||
device = self.info_devs[ha['dev']]
|
device = self.info_devs[ha['dev']]
|
||||||
|
|||||||
Reference in New Issue
Block a user