Fixes for fridge
This commit is contained in:
parent
c2765fe953
commit
9cd12e3234
2 changed files with 4 additions and 1 deletions
|
@ -9,7 +9,7 @@ class HonParameterEnum(HonParameter):
|
|||
self._default = attributes.get("defaultValue")
|
||||
self._value = self._default or "0"
|
||||
self._values: List[str] = attributes.get("enumValues", [])
|
||||
if self._default and str(self._default) not in self.values:
|
||||
if self._default and str(self._default.strip("[]")) not in self.values:
|
||||
self._values.append(self._default)
|
||||
|
||||
def __repr__(self) -> str:
|
||||
|
|
|
@ -26,10 +26,13 @@ class HonRuleSet:
|
|||
for entity_key, params in rule.items():
|
||||
entity_key = self._command.appliance.options.get(entity_key, entity_key)
|
||||
for trigger_key, values in params.items():
|
||||
trigger_key = trigger_key.replace("@", "")
|
||||
trigger_key = self._command.appliance.options.get(
|
||||
trigger_key, trigger_key
|
||||
)
|
||||
for trigger_value, entity_value in values.items():
|
||||
if entity_value.get("fixedValue") == f"@{entity_key}":
|
||||
continue
|
||||
self._rules.setdefault(trigger_key, []).append(
|
||||
HonRule(
|
||||
trigger_key,
|
||||
|
|
Loading…
Reference in a new issue