Frequenz-client-microgrid

Latest version: v0.6.0

Safety actively analyzes 687918 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.6.0

Frequenz Microgrid API Client Release Notes

Upgrading

- `ApiClient`:

* The class was renamed to `MicrogridApiClient`.
* The `api` attribute was renamed to `stub`.
* The constructor parameter `channel_options` was renamed to `channels_defaults` to match the name used in `BaseApiClient`.
* The constructor now accepts a `connect` parameter, which is `True` by default. If set to `False`, the client will not connect to the server upon instantiation. You can connect later by calling the `connect()` method.

* The `frequenz-client-base` dependency was bumped to v0.8.0.

New Features

- The client now inherits from `frequenz.client.base.BaseApiClient`, so it provides a few new features, like `disconnect()`ing or using it as a context manager. Please refer to the [`BaseApiClient` documentation](https://frequenz-floss.github.io/frequenz-client-base-python/latest/reference/frequenz/client/base/client/#frequenz.client.base.client.BaseApiClient) for more information on these features.
- The client now supports setting reactive power for components through the new `set_reactive_power` method.


What's Changed
* Clear release notes by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/87
* Inherit from `BaseApiClient` by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/88
* Use `call_stub_method()` to call stub methods by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/89
* Remove duplicated `show_symbol_type_toc` key in `mkdocs.yml` by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/90
* Bump mkdocstrings dependencies by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/91
* Bump the required group with 5 updates by dependabot in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/92
* Bump the required group with 7 updates by dependabot in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/95
* Bump types-protobuf from 4.21.0.7 to 5.28.3.20241030 by dependabot in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/97
* Add the `set_reactive_power` method by shsms in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/99
* Update the `client-base` dependency to v0.8.0 by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/100
* Prepare for the v0.6.0 release by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/101


**Full Changelog**: https://github.com/frequenz-floss/frequenz-client-microgrid-python/compare/v0.5.1...v0.6.0

0.5.2

Frequenz Microgrid API Client Release Notes

New Features

- The client now supports setting reactive power for components through the new `set_reactive_power` method.


What's Changed
* Add the `set_reactive_power` method by shsms in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/99


**Full Changelog**: https://github.com/frequenz-floss/frequenz-client-microgrid-python/compare/v0.5.1...v0.5.2

0.5.1

Frequenz Microgrid API Client Release Notes

Bug Fixes

- Fix a bug where SSL was enabled by default. It is now disabled by default as in previous versions.


What's Changed
* Clear release notes by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/83
* Disable SSL by default by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/85
* Bump the required group across 1 directory with 4 updates by dependabot in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/86


**Full Changelog**: https://github.com/frequenz-floss/frequenz-client-microgrid-python/compare/v0.5.0...v0.5.1

0.5.0

Frequenz Microgrid API Client Release Notes

Upgrading

- This release stops using `betterproto` and `grpclib` as backend for gRPC and goes back to using Google's `grpcio` and `protobuf`.

If your code was using `betterproto` and `grpclib`, it now needs to be ported to use `grpcio` and `protobuf` too. Remember to also remove any `betterproto` and `grpclib` dependencies from your project.

- We are now using base-client v0.6.0.



What's Changed
* Clear release notes by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/56
* Bump the required group with 14 updates by dependabot in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/57
* Bump docker/build-push-action from 5 to 6 by dependabot in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/58
* Bump brettcannon/check-for-changed-files from 1.2.0 to 1.2.1 by dependabot in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/59
* Configure dependabot to have separate minor updates for in-devel deps by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/61
* Bump mike from 2.1.1 to 2.1.2 by dependabot in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/65
* Bump pytest from 8.2.1 to 8.2.2 by dependabot in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/67
* Bump pydoclint from 0.4.1 to 0.5.3 by dependabot in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/63
* Fix patterns in dependabot.yml by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/70
* Bump the required group with 4 updates by dependabot in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/72
* Group GitHub action dependabot updates by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/71
* Bump the required group across 1 directory with 15 updates by dependabot in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/78
* Drop `betterproto`/`grpclib` (and upgrade `client-base`) by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/80
* Disable` pylint`s `no-name-in-module` check by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/81
* Prepare readme for release by Marenz in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/82

New Contributors
* Marenz made their first contribution in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/82

**Full Changelog**: https://github.com/frequenz-floss/frequenz-client-microgrid-python/compare/v0.4.0...v0.5.0

0.4.0

Frequenz Microgrid API Client Release Notes

Summary

This release migrates to use `betterproto` and `grpclib` instead of `grpcio` and `protobuf` internally. It also stops *leaking* these internal libraries to downstream users. It should now be possible to use the client without having to use `grpclib` or `betterproto` directly.

Upgrading

- The client now uses a string URL to connect to the server, the `grpc_channel` and `target` arguments are now replaced by `server_url`. The current accepted format is `grpc://hostname[:<port:int=9090>][?ssl=<ssl:bool=false>]`, meaning that the `port` and `ssl` are optional and default to 9090 and `false` respectively. You will have to adapt the way you connect to the server in your code.

- The client is now using [`grpclib`](https://pypi.org/project/grpclib/) to connect to the server instead of [`grpcio`](https://pypi.org/project/grpcio/). You might need to adapt your code if you are using `grpcio` directly.

- The client now doesn't raise `grpc.aio.RpcError` exceptions anymore. Instead, it raises its own exceptions, one per gRPC error status code, all inheriting from `GrpcError`, which in turn inherits from `ClientError` (as any other exception raised by this library in the future). `GrpcError`s have the `grpclib.GRPCError` as their `__cause__`. You might need to adapt your error handling code to catch these specific exceptions instead of `grpc.aio.RpcError`.

You can also access the underlying `grpclib.GRPCError` using the `grpc_error` attribute for `GrpStatusError` exceptions, but it is discouraged because it makes downstream projects dependant on `grpclib` too

- The client now uses protobuf/grpc bindings generated [betterproto](https://github.com/danielgtaylor/python-betterproto) ([frequenz-microgrid-betterproto](https://github.com/frequenz-floss/frequenz-microgrid-betterproto-python)) instead of [grpcio](https://pypi.org/project/grpcio/) ([frequenz-api-microgrid](https://github.com/frequenz-floss/frequenz-api-microgrid)). If you were using the bindings directly, you might need to do some minor adjustments to your code.

- If an unknown EV charger component state is received, it will now be set to `EVChargerComponentState.UNKNOWN` instead of `EVChargerComponentState.UNSPECIFIED`.

New Features

- The client now raises more specific exceptions based on the gRPC status code, so you can more easily handle different types of errors.

For example:

python
try:
connections = await client.connections()
except OperationTimedOut:
...


instead of:

python
try:
connections = await client.connections()
except grpc.aio.RpcError as e:
if e.code() == grpc.StatusCode.DEADLINE_EXCEEDED:
...


- We now expose component errors as part of the streamed component data:

* `BatteryData.errors`
* `InverterData.errors`

- We now expose component states as part of the streamed component data:

* `BatteryData.component_state` and `BatteryData.relay_state`
* `InverterData.component_state`

- Added the missing `EVChargerComponentState.UNKNOWN` state.

Bug Fixes

- Fix a leakage of `GrpcStreamBroadcaster` instances.
- The user-passed retry strategy was not properly used by the data streaming methods.
- The client `set_bounds()` method might have not done anything and if it did, errors were not properly raised.


What's Changed
* Clear release notes by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/32
* Bump nox from 2023.4.22 to 2024.3.2 by dependabot in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/35
* Update protobuf requirement from <5,>=4.21.6 to >=4.21.6,<6 by dependabot in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/34
* Bump nox from 2024.3.2 to 2024.4.15 in the required group by dependabot in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/38
* Improve exception messages by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/43
* Fix a few bugs related to `GrpcStreamBroadcaster` by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/42
* Bump client-base to v0.4.0 by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/44
* Properly await for `AddInclusionBounds` by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/47
* Allow using `None` to specify the default retry strategy by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/46
* Raise a new `ClientError` instead of `AioRpcError` by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/48
* Convert to `betterproto` by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/37
* Make the client accept a server URL to connect to by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/49
* Add specific gRPC client errors by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/53
* Add missing state and error wrappers by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/54


**Full Changelog**: https://github.com/frequenz-floss/frequenz-client-microgrid-python/compare/v0.3.0...v0.4.0

0.3.0

Frequenz Microgrid API Client Release Notes

New Features

- The `reactive_power` is exposed for meters, inverters and EV chargers.


What's Changed
* Clear RELEASE_NOTES.md by shsms in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/27
* Add reactive power for inverters, meters and EV chargers by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/30
* Improve Location docs and tests by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/29
* Widen the channels dependency by llucax in https://github.com/frequenz-floss/frequenz-client-microgrid-python/pull/31


**Full Changelog**: https://github.com/frequenz-floss/frequenz-client-microgrid-python/compare/v0.2.0...v0.3.0

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.