I ran into a problem that the drain value of the electric source (50W) of the lamp entity is not the same as the actual value from the electric network statistics (13.3kW):

And this actual value correlates only to the energy_usage_per_tick property of my custom prototype:
800kW => 26.5kW
400kW => 13.3kW
Code: Select all
data:extend({
{
type = "lamp",
name = "UV-lamp",
...
energy_source =
{
type = "electric",
usage_priority = "secondary-input",
buffer_capacity = "400kJ",
input_flow_limit = "9600kW",
drain = "0.05kW"
},
energy_usage_per_tick = "400kW",
...
[0. Add new instance of the lamp prototype;]
1. Add the drain property into energy_source = { ... };
2. Run Factorio and place single lamp entity, add power generation for it;
3. Check drain in the entity properties (which is equal to the drain value from the entity);
4. Check value from the electric network stats (which is different).
Thanks,
Alex