Skip to content

Commit 919aab3

Browse files
authored
Initial upgrade to the API v0.17.x (#94)
This is a major breaking change, as we jump to the API specification version 0.17.x, which introduces big and fundamental breaking changes. This also starts using the `v1` namespace in `frequenz-api-common`, which also introduces major breaking changes. It would be very hard to detail all the API changes here, please refer to the [Microgrid API releases](https://github.com/frequenz-floss/frequenz-api-microgrid/releases) and [Common API releases](https://github.com/frequenz-floss/frequenz-api-common/releases). This PR also only focus on migrating the current functionality to v0.17.x, and it is the starting point, only implementing `GetMicrogridMetadata`. Other RPCs will be implemented in follow-up PRs. Also many of the things added here will be moved to other repos. All protobuf wrappers for `api-common` will be moved to `client-common`, and the test framework for API clients will be moved to `client-base`. Part of #55.
2 parents 20cfe44 + dc9214f commit 919aab3

32 files changed

+2619
-4601
lines changed

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ classifiers = [
3636
]
3737
requires-python = ">= 3.11, < 4"
3838
dependencies = [
39-
"frequenz-api-microgrid >= 0.15.5, < 0.16.0",
40-
"frequenz-channels >= 1.0.0-rc1, < 2.0.0",
41-
"frequenz-client-base >= 0.8.0, < 0.12.0",
39+
"frequenz-api-microgrid >= 0.17.2, < 0.18.0",
40+
"frequenz-channels >= 1.6.1, < 2.0.0",
41+
"frequenz-client-base >= 0.10.0, < 0.12.0",
4242
"frequenz-client-common >= 0.3.2, < 0.4.0",
43-
"grpcio >= 1.63.0, < 2",
44-
"protobuf >= 5.26.1, < 7",
43+
"grpcio >= 1.72.1, < 2",
44+
"protobuf >= 6.31.1, < 7",
4545
"timezonefinder >= 6.2.0, < 7",
4646
"typing-extensions >= 4.13.0, < 5",
4747
]

src/frequenz/client/microgrid/__init__.py

Lines changed: 13 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,12 @@
77
"""
88

99

10-
from ._client import MicrogridApiClient
11-
from ._component import (
12-
Component,
13-
ComponentCategory,
14-
ComponentMetadata,
15-
ComponentMetricId,
16-
ComponentType,
17-
Fuse,
18-
GridMetadata,
19-
InverterType,
10+
from ._client import (
11+
DEFAULT_CHANNEL_OPTIONS,
12+
DEFAULT_GRPC_CALL_TIMEOUT,
13+
MicrogridApiClient,
2014
)
21-
from ._component_data import (
22-
BatteryData,
23-
ComponentData,
24-
EVChargerData,
25-
InverterData,
26-
MeterData,
27-
)
28-
from ._component_error import (
29-
BatteryError,
30-
BatteryErrorCode,
31-
ErrorLevel,
32-
InverterError,
33-
InverterErrorCode,
34-
)
35-
from ._component_states import (
36-
BatteryComponentState,
37-
BatteryRelayState,
38-
EVChargerCableState,
39-
EVChargerComponentState,
40-
InverterComponentState,
41-
)
42-
from ._connection import Connection
15+
from ._delivery_area import DeliveryArea, EnergyMarketCodeType
4316
from ._exception import (
4417
ApiClientError,
4518
ClientNotConnected,
@@ -63,45 +36,27 @@
6336
UnrecognizedGrpcStatus,
6437
)
6538
from ._lifetime import Lifetime
66-
from ._metadata import Location, Metadata
39+
from ._location import Location
40+
from ._microgrid_info import MicrogridInfo, MicrogridStatus
6741

6842
__all__ = [
6943
"ApiClientError",
70-
"BatteryComponentState",
71-
"BatteryData",
72-
"BatteryError",
73-
"BatteryErrorCode",
74-
"BatteryRelayState",
7544
"ClientNotConnected",
76-
"Component",
77-
"ComponentCategory",
78-
"ComponentData",
79-
"ComponentMetadata",
80-
"ComponentMetricId",
81-
"ComponentType",
82-
"Connection",
45+
"DEFAULT_CHANNEL_OPTIONS",
46+
"DEFAULT_GRPC_CALL_TIMEOUT",
8347
"DataLoss",
84-
"EVChargerCableState",
85-
"EVChargerComponentState",
86-
"EVChargerData",
48+
"DeliveryArea",
49+
"EnergyMarketCodeType",
8750
"EntityAlreadyExists",
8851
"EntityNotFound",
89-
"ErrorLevel",
90-
"Fuse",
91-
"GridMetadata",
9252
"GrpcError",
9353
"InternalError",
9454
"InvalidArgument",
95-
"InverterComponentState",
96-
"InverterData",
97-
"InverterError",
98-
"InverterErrorCode",
99-
"InverterType",
10055
"Lifetime",
10156
"Location",
102-
"Metadata",
103-
"MeterData",
10457
"MicrogridApiClient",
58+
"MicrogridInfo",
59+
"MicrogridStatus",
10560
"OperationAborted",
10661
"OperationCancelled",
10762
"OperationNotImplemented",

0 commit comments

Comments
 (0)