frequenz-client-microgrid 0.5.1__tar.gz → 0.5.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/PKG-INFO +1 -1
  2. frequenz-client-microgrid-0.5.2/RELEASE_NOTES.md +5 -0
  3. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/pyproject.toml +2 -0
  4. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/src/frequenz/client/microgrid/_client.py +35 -1
  5. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/src/frequenz_client_microgrid.egg-info/PKG-INFO +1 -1
  6. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/src/frequenz_client_microgrid.egg-info/requires.txt +2 -0
  7. frequenz-client-microgrid-0.5.1/RELEASE_NOTES.md +0 -5
  8. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/LICENSE +0 -0
  9. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/MANIFEST.in +0 -0
  10. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/README.md +0 -0
  11. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/setup.cfg +0 -0
  12. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/src/frequenz/client/microgrid/__init__.py +0 -0
  13. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/src/frequenz/client/microgrid/_component.py +0 -0
  14. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/src/frequenz/client/microgrid/_component_data.py +0 -0
  15. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/src/frequenz/client/microgrid/_component_error.py +0 -0
  16. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/src/frequenz/client/microgrid/_component_states.py +0 -0
  17. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/src/frequenz/client/microgrid/_connection.py +0 -0
  18. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/src/frequenz/client/microgrid/_constants.py +0 -0
  19. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/src/frequenz/client/microgrid/_exception.py +0 -0
  20. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/src/frequenz/client/microgrid/_metadata.py +0 -0
  21. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/src/frequenz/client/microgrid/conftest.py +0 -0
  22. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/src/frequenz/client/microgrid/py.typed +0 -0
  23. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/src/frequenz_client_microgrid.egg-info/SOURCES.txt +0 -0
  24. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/src/frequenz_client_microgrid.egg-info/dependency_links.txt +0 -0
  25. {frequenz-client-microgrid-0.5.1 → frequenz-client-microgrid-0.5.2}/src/frequenz_client_microgrid.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: frequenz-client-microgrid
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary: Microgrid API client for Python
5
5
  Author-email: Frequenz Energy-as-a-Service GmbH <floss@frequenz.com>
6
6
  License: MIT
@@ -0,0 +1,5 @@
1
+ # Frequenz Microgrid API Client Release Notes
2
+
3
+ ## New Features
4
+
5
+ - The client now supports setting reactive power for components through the new `set_reactive_power` method.
@@ -73,7 +73,9 @@ dev-mkdocs = [
73
73
  ]
74
74
  dev-mypy = [
75
75
  "mypy == 1.11.2",
76
+ "grpc-stubs == 1.53.0.5",
76
77
  "types-Markdown == 3.7.0.20240822",
78
+ "types-protobuf == 5.28.3.20241030",
77
79
  # For checking the noxfile, docs/ script, and tests
78
80
  "frequenz-client-microgrid[dev-mkdocs,dev-noxfile,dev-pytest]",
79
81
  ]
@@ -441,7 +441,41 @@ class ApiClient:
441
441
  grpc_error=grpc_error,
442
442
  ) from grpc_error
443
443
 
444
- async def set_bounds(
444
+ async def set_reactive_power( # noqa: DOC502 (raises ApiClientError indirectly)
445
+ self, component_id: int, reactive_power_var: float
446
+ ) -> None:
447
+ """Send request to the Microgrid to set reactive power for component.
448
+
449
+ Negative values are for inductive (lagging) power , and positive values are for
450
+ capacitive (leading) power.
451
+
452
+ Args:
453
+ component_id: id of the component to set power.
454
+ reactive_power_var: reactive power to set for the component.
455
+
456
+ Raises:
457
+ ApiClientError: If the are any errors communicating with the Microgrid API,
458
+ most likely a subclass of
459
+ [GrpcError][frequenz.client.microgrid.GrpcError].
460
+ """
461
+ try:
462
+ await cast(
463
+ Awaitable[Empty],
464
+ self.api.SetPowerReactive(
465
+ microgrid_pb2.SetPowerReactiveParam(
466
+ component_id=component_id, power=reactive_power_var
467
+ ),
468
+ timeout=int(DEFAULT_GRPC_CALL_TIMEOUT),
469
+ ),
470
+ )
471
+ except grpc.aio.AioRpcError as grpc_error:
472
+ raise ApiClientError.from_grpc_error(
473
+ server_url=self._server_url,
474
+ operation="SetPowerReactive",
475
+ grpc_error=grpc_error,
476
+ ) from grpc_error
477
+
478
+ async def set_bounds( # noqa: DOC503 (raises ApiClientError indirectly)
445
479
  self,
446
480
  component_id: int,
447
481
  lower: float,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: frequenz-client-microgrid
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary: Microgrid API client for Python
5
5
  Author-email: Frequenz Energy-as-a-Service GmbH <floss@frequenz.com>
6
6
  License: MIT
@@ -34,7 +34,9 @@ frequenz-repo-config[lib]==0.10.0
34
34
 
35
35
  [dev-mypy]
36
36
  mypy==1.11.2
37
+ grpc-stubs==1.53.0.5
37
38
  types-Markdown==3.7.0.20240822
39
+ types-protobuf==5.28.3.20241030
38
40
  frequenz-client-microgrid[dev-mkdocs,dev-noxfile,dev-pytest]
39
41
 
40
42
  [dev-noxfile]
@@ -1,5 +0,0 @@
1
- # Frequenz Microgrid API Client Release Notes
2
-
3
- ## Bug Fixes
4
-
5
- - Fix a bug where SSL was enabled by default. It is now disabled by default as in previous versions.