Skip to content

Cleanup useless battery box metadata #401

Open
@S-S-X

Description

@S-S-X

Some cleanup was done a moment ago:

Adding this new issue for leftovers to keep things easier to follow.

It would be possible to remove all metadata from batteries and only store values for charge and max_charge at network level.

However that would make it impossible to detach battery from network by digging cable that connects it to network and also destroying network data would either reset batteries or would require complex handling for batteries, I think having metadata for that is good so maybe not remove that (internal_EU_charge).

Next changes for battery handling

Batteries are not functional when not attached to network which means that *_EU_supply and *_EU_demand meta data values for batteries could be removed completely. Possibly also internal_EU_charge_max. Those are still there but not used that much after last PR #126

This requires always balancing charge level between batteries attached to network, it is done already to some degree but is bit buggy. Take battery upgrades into account as those allow having different maximum capacity for batteries, therefore it would be best to allow battery to set actual charge values and only inform batteries about network charge level as percentage value. That would also fix current glitches with having 1000kEU max charge battery with 1200kEU actual charge.

Originally posted by @S-S-X in #108

Metadata

Metadata

Assignees

No one assigned

    Labels

    CleanupCleanup of bad code or other redundant/unnecessary stuffPerformanceAims to improve technical performance.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions