frequenz-floss / frequenz-api-common

Shared protobuf definitions and Python bindings for Frequenz APIs
https://frequenz-floss.github.io/frequenz-api-common/
MIT License
1 stars 11 forks source link

Mismatch between category `GRID` and metadata `GridConnectionPoint` #255

Open llucax opened 2 weeks ago

llucax commented 2 weeks ago

What's needed?

All component categories match the name of the message that carries category-specific metadata. COMPONENT_CATEGORY_BATTERY -> message Battery -> ComponentCategoryMetadataVariant.metadata.battery, except for the grid: COMPONENT_CATEGORY_GRID -> message GridConnectionPoint -> ComponentCategoryMetadataVariant.metadata.grid.

Proposed solution

Rename the fields to be consistent. I guess the desired name is grid connection point as it is more specific and introduced in newer versions of the API, so:

Use cases

In particular the inconsistency between ComponentCategoryMetadataVariant.metadata and COMPONENT_CATEGORY_XXX makes it hard to do sanity checks to make sure the declared category and attached metadata category matches in a programatic way.