Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check to prevent crashing grott on unknown layout #569

Open
wants to merge 1 commit into
base: Master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions grottdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,19 @@ def procdata(conf,data):
# Update the conf.layout like done earlier
conf.layout = layout

layout_exists = layout in conf.recorddict

if conf.verbose:
print("\t - " + 'Growatt new layout processing')
print("\t\t - " + "decrypt : ",conf.decrypt)
print("\t\t - " + "offset : ", conf.offset)
print("\t\t - " + "record layout : ", layout)
print("\t\t - " + "layout exists : ", layout_exists)
print()



if not layout_exists:
return # No valid layout found, no further processing

try:
#v270 try if logstart and log fields are defined, if yes prepare log fields
logstart = conf.recorddict[layout]["logstart"]["value"]
Expand Down