Fix AttributeError in EEP parser for missing enum values#27
Fix AttributeError in EEP parser for missing enum values#27ChristopheHD merged 4 commits intomscfrom
Conversation
Add F6-02-03 Light Control - Application Style 1 Tested for over a year but never took the time to add it: now it's done.
F6-02-03 and D2-01-08
When parsing an EnOcean packet, if an enum value or rangeitem is not found in the EEP XML definition, the parser would raise an AttributeError because it tried to call .get() on a None object. This commit adds a robust check and a fallback to returning the raw value as a string when the description is missing. Added a regression test in enocean/protocol/tests/test_eep.py. Co-authored-by: ChristopheHD <16214389+ChristopheHD@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Pull Request Test Coverage Report for Build 21480673029Details
💛 - Coveralls |
The EEP parser was crashing with an
AttributeErrorwhen encountering an enum value that wasn't defined in the EEP.xml. This was especially problematic for the new MSC telegrams where some fields might have values not yet fully defined in the XML.Changes:
_get_enuminenocean/protocol/eep.pyto handlevalue_desc is None.str(raw_value)if description is missing.test_unknown_enumto verify the fix and prevent regressions.PR created automatically by Jules for task 342066479357758187 started by @ChristopheHD