Skip to content

Commit e9ad96a

Browse files
committed
Add EnterpriseId
This ID will be used for getting the microgrid information. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 7b84559 commit e9ad96a

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/frequenz/client/microgrid/id.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,11 @@ def __str__(self) -> str:
203203
return f"{type(self)._str_prefix}{self._id}"
204204

205205

206+
@final
207+
class EnterpriseId(BaseId, str_prefix="EID"):
208+
"""A unique identifier for an enterprise account."""
209+
210+
206211
@final
207212
class MicrogridId(BaseId, str_prefix="MID"):
208213
"""A unique identifier for a microgrid."""

tests/test_id.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
# License: MIT
22
# Copyright © 2025 Frequenz Energy-as-a-Service GmbH
33

4-
"""Tests for the microgrid and component IDs."""
4+
"""Tests for IDs."""
55

66
from dataclasses import dataclass
77

88
import pytest
99

10-
from frequenz.client.microgrid.id import ComponentId, MicrogridId, SensorId
10+
from frequenz.client.microgrid.id import (
11+
ComponentId,
12+
EnterpriseId,
13+
MicrogridId,
14+
SensorId,
15+
)
1116

1217

1318
@dataclass(frozen=True)
@@ -20,6 +25,7 @@ class IdTypeInfo:
2025

2126
# Define all ID types to test here
2227
ID_TYPES: list[IdTypeInfo] = [
28+
IdTypeInfo(EnterpriseId, "EID"),
2329
IdTypeInfo(MicrogridId, "MID"),
2430
IdTypeInfo(ComponentId, "CID"),
2531
IdTypeInfo(SensorId, "SID"),

0 commit comments

Comments
 (0)