Skip to content

Commit

Permalink
added all other schedules
Browse files Browse the repository at this point in the history
code generated [not dynamic any longer]
  • Loading branch information
marq24 committed Feb 26, 2024
1 parent b07f679 commit bf6a288
Show file tree
Hide file tree
Showing 12 changed files with 8,080 additions and 871 deletions.
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ pythonenv*
.coverage
venv
.venv
custom_components/pywaterkotte/*
custom_components/pywaterkott*
core.*
custom_components/waterkotte_heatpump/pywaterkotte
/waterkotte-integration.iml
*.iml
/generator/gen_*.txt
16 changes: 10 additions & 6 deletions custom_components/waterkotte_heatpump/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,12 +300,16 @@ def _name_internal_code_generated(self, key, platform_translations: dict[str, An
temp = key.lower().replace('_', ' ')
temp = temp.replace(' enable', '')
temp = temp.replace(' value', '')
list = ["schedule", "heating", "cooling", "water", "adjust",
"1mo", "2tu", "3we", "4th", "5fr", "6sa", "7su",
"start time", "end time"]
for a_key in list:
temp = temp.replace(a_key, platform_translations.get(
f"component.{self.platform.platform_name}.entity.code_gen.{a_key.replace(' ', '_')}.name"))
a_list = ["schedule", "heating", "cooling", "water", "pool", "solar", "pv",
"mix1", "mix2", "mix3", "buffer tank circulation pump", "adjust",
"1mo", "2tu", "3we", "4th", "5fr", "6sa", "7su",
"start time", "end time"]
for a_key in a_list:
f_key = f"component.{self.platform.platform_name}.entity.code_gen.{a_key.replace(' ', '_')}.name"
if f_key in platform_translations:
temp = temp.replace(a_key, platform_translations.get(f_key))
else:
_LOGGER.warning(f"{a_key} -> {f_key} not found in platform_translations")

return temp#.title()

Expand Down
Loading

0 comments on commit bf6a288

Please sign in to comment.