frequenz-floss / frequenz-client-microgrid-python

Microgrid API client for Python
https://frequenz-floss.github.io/frequenz-client-microgrid-python/
MIT License
0 stars 5 forks source link

Properly await for `AddInclusionBounds` #47

Closed llucax closed 4 months ago

llucax commented 4 months ago

Without this, the function call will never actually run. I'm not sure if this was working anyways because of some obscure implementation detail in grpcio, but in normal python a not awaited async function should never actually run.

Besides this, for sure errors can't be really caught without the await either.

This was detected while migrating to betterproto, as betterproto has correct type hints.

shsms commented 4 months ago

Btw, the SDK doesn't use the set_bounds method anymore. We use set_power for both EV chargers and PV inverters.

The previous version of the EV charger pool was using this implementation of set_bounds, but that was never deployed.

The older version of the EV charger that was deployed in a demo installation was using an older streaming set_bounds method, so this existing one was never used, and won't be used anymore by the SDK.

llucax commented 4 months ago

OK, I guess that explains why we didn't notice.