I've decided not to add it. There's no reliable way to migrate from one way to the other in a way that includes items, ghosts, blueprints, etc.
Here is a command you can use though. Use at own risk, and keep a backup save! It should print out the locations of valves that didn't fit any of the three new valve configurations.
/c
local function deduce_type(behaviour)
local circuit_condition = behaviour.circuit_condition
local first = circuit_condition.first_signal and circuit_condition.first_signal.name
local second = circuit_condition.second_signal and circuit_condition.second_signal.name
if first == "signal-I" and not second and circuit_condition.comparator == ">" then
return "overflow"
elseif first == "signal-O" and not second and circuit_condition.comparator == "<" then
return "top_up"
elseif first == "signal-I" and second == "signal-O" and circuit_condition.comparator == ">" then
return "one_way"
end
end
for _, surface in pairs(game.surfaces) do
for _, configurable_valve in pairs(surface.find_entities_filtered{name="configurable-valve"}) do
local configurable_behaviour = configurable_valve.get_or_create_control_behavior()
local valve_type = deduce_type(configurable_behaviour)
if not valve_type then
game.print("Unknown valve configuration not migrated at: "..valve.gps_tag)
continue
end
local threshold
if valve_type == "overflow" or valve_type == "top_up" then
threshold = configurable_behaviour.circuit_condition.constant
if not threshold then threshold = valve_type == "overflow" and 80 or 50 end
end
local position = configurable_valve.position
local direction = configurable_valve.direction
local force = configurable_valve.force
configurable_valve.destroy{ raise_destroy = true }
local valve = surface.create_entity{
name = valve_type and "valves-"..valve_type or "valves-overflow",
position = position,
direction = direction,
force = force,
raise_built = true,
}
if valve then
local behaviour = valve.get_or_create_control_behavior()
behaviour.circuit_condition.constant = threshold or 100
end
::continue::
end
end