Description
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 alsointernal_EU_charge_max
. Those are still there but not used that much after last PR #126This 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.