Compare commits

..

No commits in common. "main" and "v0.3.1" have entirely different histories.
main ... v0.3.1

3 changed files with 6 additions and 17 deletions

View File

@ -8,11 +8,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
# [unreleased]
# [v0.3.2]
- Added handling for duplicate event names when writing the event translation
file.
# [v0.3.1]
- Sorted returnvalue export by raw returnvalue.

View File

@ -1,5 +1,5 @@
__version__ = "0.3.2"
__version__ = "0.3.1"
VERSION_MAJOR = 0
VERSION_MINOR = 3
VERSION_REVISION = 2
VERSION_REVISION = 1

View File

@ -274,16 +274,10 @@ def write_translation_source_file(
event_id = entry[0]
event_value = entry[1]
name = event_value.name
if name in lut:
_LOGGER.warning(
"Duplicate name detected when generating event translation source file"
)
_LOGGER.warning(f"Name: {name}, Event Entry: {event_value}")
name = f"{name}_{event_id}"
_LOGGER.info(f"Created unique name {name}")
definitions += f"const char *{name}_STRING " f'= "{name}";\n'
function += f" case ({event_id}):\n " f"return {name}_STRING;\n"
lut.update({name: event_value})
if name not in lut:
definitions += f"const char *{name}_STRING " f'= "{name}";\n'
function += f" case ({event_id}):\n " f"return {name}_STRING;\n"
lut.update({name: event_value})
function += ' default:\n return "UNKNOWN_EVENT";\n'
out.write(
f"/**\n * @brief Auto-generated event translation file. "