File tree Expand file tree Collapse file tree 2 files changed +10
-6
lines changed
src/frequenz/client/common Expand file tree Collapse file tree 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 33
44"""Module to define the metrics used with the common client."""
55
6- from enum import Enum
6+ import enum
77from typing import Self
88
99# pylint: disable=no-name-in-module
1212# pylint: enable=no-name-in-module
1313
1414
15- class Metric (Enum ):
15+ @enum .unique
16+ class Metric (enum .Enum ):
1617 """List of supported metrics.
1718
1819 AC energy metrics information:
Original file line number Diff line number Diff line change 55
66from __future__ import annotations
77
8- from enum import Enum
8+ import enum
99from typing import final
1010
1111# pylint: disable=no-name-in-module
@@ -28,7 +28,8 @@ class ComponentId(BaseId, str_prefix="CID"):
2828 """A unique identifier for a microgrid component."""
2929
3030
31- class ComponentCategory (Enum ):
31+ @enum .unique
32+ class ComponentCategory (enum .Enum ):
3233 """Possible types of microgrid component."""
3334
3435 UNSPECIFIED = PBComponentCategory .COMPONENT_CATEGORY_UNSPECIFIED
@@ -81,7 +82,8 @@ def to_proto(self) -> PBComponentCategory.ValueType:
8182 return self .value
8283
8384
84- class ComponentStateCode (Enum ):
85+ @enum .unique
86+ class ComponentStateCode (enum .Enum ):
8587 """All possible states of a microgrid component."""
8688
8789 UNSPECIFIED = PBComponentStateCode .COMPONENT_STATE_CODE_UNSPECIFIED
@@ -185,7 +187,8 @@ def to_proto(self) -> PBComponentStateCode.ValueType:
185187 return self .value
186188
187189
188- class ComponentErrorCode (Enum ):
190+ @enum .unique
191+ class ComponentErrorCode (enum .Enum ):
189192 """All possible errors that can occur across all microgrid component categories."""
190193
191194 UNSPECIFIED = PBComponentErrorCode .COMPONENT_ERROR_CODE_UNSPECIFIED
You can’t perform that action at this time.
0 commit comments