Skip to content

Commit

Permalink
remove _low or _high prefix from entity name
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarv committed Aug 7, 2024
1 parent a38f420 commit 4220fc2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions esphome/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
secrets.yaml
*.pyc
.vscode
.venv

notes.md
can.log
5 changes: 5 additions & 0 deletions esphome/hoval_data_processing/generate_presets.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import openpyxl
from openpyxl import Workbook
from typing import Callable, Optional
import re

PatchFunc = Callable[[list[Datapoint], str], None]

Expand All @@ -26,6 +27,10 @@ def generate(self, wb: Workbook, out_dir: pathlib.Path):

if self.before_dump:
self.before_dump(datapoints, locale)

for dp in datapoints:
if dp.type_name in ["U32", "S32"]:
dp.name = re.sub(r'(_low|_high)$', "", dp.name)

os.makedirs(out_dir.joinpath(self.id), exist_ok=True)

Expand Down

0 comments on commit 4220fc2

Please sign in to comment.