Skip to content

Commit

Permalink
Fix issue with key filtering in debug files (#1871)
Browse files Browse the repository at this point in the history
* Fix issue with key filtering in debug files

* Typo

* [pre-commit.ci lite] apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
  • Loading branch information
springfall2008 and pre-commit-ci-lite[bot] authored Jan 12, 2025
1 parent 7ec82e0 commit d19b610
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion apps/predbat/userinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ def create_debug_yaml(self, write_file=True):

os.makedirs(os.path.dirname(filename), exist_ok=True)
debug = {}

# Store all predbat member variables into debug
for key in self.__dict__:
if not key.startswith("__") and not callable(getattr(self, key)):
Expand All @@ -632,7 +633,14 @@ def create_debug_yaml(self, write_file=True):
):
pass
else:
debug[key] = self.__dict__[key]
if key == "args":
# Remove keys from args
debug[key] = copy.deepcopy(self.__dict__[key])
for sub_key in debug[key]:
if "_key" in sub_key:
debug[key][sub_key] = "xxx"
else:
debug[key] = self.__dict__[key]
inverters_debug = []
for inverter in self.inverters:
inverter_debug = {}
Expand Down

0 comments on commit d19b610

Please sign in to comment.