Describe the bug
The PowerCircuit:getGroupPrioritySwitches() method always returns an empty table, even if there are priority switches on the circuit.
To Reproduce
Steps to reproduce the behavior:
- Build a computer with EEPROM and network card
- Build a circuit with any power generator, a priority switch, and any power consumer (eg a Hypertube Entrance with a tube attached).
- Connect a power pole to one side of the switch. (It doesn't matter which side)
- Connect the generator to the consumer, passing through the switch and power pole. (eg: generator -> switch -> pole -> machine, but the actual order shouldn't matter)
- Connect a network cable from the computer to the power pole.
- Run this program:
local pole = assert(component.proxy(component.findComponent(classes.Build_PowerPoleMk1_C))[1], "No PowerPoleMk1 found")
local circuit = pole:getPowerConnectors()[1]:getCircuit()
print("circuit production", circuit.production) --ensure we have the right circuit
local switches = circuit:getGroupPrioritySwitches()
for k, v in pairs(switches) do print("switch:", k, v) end
print("end of switch list")
The output should display a production value matching the circuit you've connected to (eg 10.0 in the attached save, or 0 if the switch is off); this is just to ensure I wasn't looking at some phantom circuit.
Expected behavior
There should be some switches listed in the output, but there aren't.
Additional context
Example save file
Describe the bug
The
PowerCircuit:getGroupPrioritySwitches()method always returns an empty table, even if there are priority switches on the circuit.To Reproduce
Steps to reproduce the behavior:
The output should display a production value matching the circuit you've connected to (eg 10.0 in the attached save, or 0 if the switch is off); this is just to ensure I wasn't looking at some phantom circuit.
Expected behavior
There should be some switches listed in the output, but there aren't.
Additional context
Example save file