Sorry about the wall of text, again :)
I've been following you guys convo for couple of days now, i think i get it now. Sometimes it ain't easy when everyone involved uses a secondary language to communicate. :)
If i understood it right, it's about nested switches, specifically if nested switches should be detected and what to do about them.
For example, a manual main power switch to just kill the whole sub grid, and then several automated ones for turning off segments of the same grid when needed - i use this a lot for remote outposts where power is limited and i want all available power for defense when I'm not there. So i wire defense directly to power source and then everything else behind a switch.
I think that nesting should be detected and still show small indicator instead of no_power_warning icons.
The trick comes with handling it without causing a performance hit. Recursion would be the immediate easy way to deal with it, but that can be quite wasteful on CPU cycles, especially if it runs every tick. I'm still trying to figure out a good way of doing it.
The best i come up with so far, would be to set a 'parent' on the switch, then on tick updates check if the parent has power, if yes, display small indicator, if not, display no_power_warning. So recursion to find a parent runs only the first time and then when the parent network changes.
In scenario like this:

- The power sources are drawn separately just for illustration, they are still part of the connected network.
- switches.png (7.29 KiB) Viewed 5001 times
I think that Network B could be set as a parent for Switch 2. Then, instead of doing full recursion on every update, just checking the parent for power will give the answer i seek.
But what happens if the connection between Power 2 and Network B is severed, and Switch 1 is off ?
Connection is severed, Network B would is flagged as modified.
On Switch 2 update, modified parent status is noted, recursion runs to find new parent for Switch 2.
Network A becomes parent for Switch 2.
I guess what i'm trying to say is: When doing it this way, intermediate switches can be ignored, because turning them on or off will not change the status between small indicator and no_power warning.
This way everything can be done in small segments when the events are raised, without big recursions, and in order the events come in.
I hope i'm making sense to you guys.
EDIT: Forgot to mention, if you want to visually differentiate that there are open nested switches present, just count the number of switches when finding a parent and change the color of small indicator or make it flash once in a while, if nested.