diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index b9819303..c3baf309 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,9 +1,5 @@ # Frequenz Microgrid API Client Release Notes -## Summary - - - ## Upgrading - Now component and microgrid IDs are wrapped in new classes: `ComponentId` and `MicrogridId` respectively. @@ -16,11 +12,3 @@ - Ensuring proper hash behavior in collections. To migrate you just need to wrap your `int` IDs with the appropriate class: `0` -> `ComponentId(0)` / `MicrogridId(0)`. - -## New Features - - - -## Bug Fixes - - diff --git a/src/frequenz/client/microgrid/_id.py b/src/frequenz/client/microgrid/_id.py index 411b532d..9e1b77f8 100644 --- a/src/frequenz/client/microgrid/_id.py +++ b/src/frequenz/client/microgrid/_id.py @@ -4,6 +4,10 @@ """Strongly typed IDs for microgrids and components.""" +from typing import final + + +@final class MicrogridId: """A unique identifier for a microgrid.""" @@ -53,6 +57,7 @@ def __str__(self) -> str: return f"MID{self._id}" +@final class ComponentId: """A unique identifier for a microgrid component."""