Check-in rules: Allow to check for time of day (#2061)

* Add "customtime" option

* Fix time picker output format

* Fix bug in bool_alg

* Fix test
This commit is contained in:
Raphael Michel
2021-05-07 11:29:39 +02:00
committed by GitHub
parent 366395278e
commit b5e41f4c62
8 changed files with 114 additions and 11 deletions

View File

@@ -75,12 +75,14 @@ def convert_to_dnf(rules):
rules = _distribute_or_over_and(rules)
operator = list(rules.keys())[0]
values = rules[operator]
no_list = False
if not isinstance(values, list):
values = [values]
no_list = True
rules = {
operator: [
convert_to_dnf(v) for v in values
] if len(values) > 1 else convert_to_dnf(values[0])
] if not no_list else convert_to_dnf(values[0])
}
if old_rules == rules:
break