Skip to content

Warn when several calls to microgrid.battery_pool(), ev_charger_pool(), pv_pool() are made #902

@shsms

Description

@shsms

What's needed?

Every call to microgrid.*pool() returns a new instance, with a unique source_id. Actors are supposed to hold a reference to their pools and reuse them, instead of creating a new one each time they want to send a command.

Ideally an actor should make only a single call to a *pool() method, so that the bounds it streams correspond with the requests, etc.

But if someone does it the WRONG way microgrid.battery_pool().set_power(), they are currently not informed about it by any of the checks.

Proposed solution

There needs to be a runtime check that starts printing warning logs when more than 1 call has been made to the microgrid.battery_pool() method, with the same priority and with the same set of batteries.

The log message could say that if they are made by different actors, they should explicitly set different priority values, and if they are made by the same actor, they should stop that and instead reuse the same instance.

Use cases

No response

Alternatives and workarounds

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

part:data-pipelineAffects the data pipelinetype:enhancementNew feature or enhancement visitble to users

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions