circuit_condition

class CircuitConditionMixin(
circuit_condition: Any = NOTHING,
*,
extra_keys: dict[str, Any] | None = None,
)

Allows the Entity to have an circuit condition (usually to enable it’s function).

circuit_condition : Condition

Serialized

This attribute is imported/exported from blueprint strings.

The circuit condition that must be passed in order for this entity to function, if configured to do so.

set_circuit_condition(
first_operand: SignalID | None = None,
comparator: '>' | '<' | '=' | '==' | '≥' | '>=' | '≤' | '<=' | '≠' | '!=' = '<',
second_operand: SignalID | int = 0,
)

Sets the circuit condition of the Entity. comparator can be specified as stored as the single unicode character which is used by Factorio, or you can use the Python-style 2-character equivalents:

# One of:
[">", "<", "=",  "≥",  "≤",  "≠"]
# Or, alternatively:
[">", "<", "==", ">=", "<=", "!="]

If specified in the second format, they are converted to and stored as the first format.

Parameters:
first_operand: SignalID | None = None

The first signal, it’s name, or None.

comparator: '>' | '<' | '=' | '==' | '≥' | '>=' | '≤' | '<=' | '≠' | '!=' = '<'

The comparator string.

second_operand: SignalID | int = 0

The second signal, it’s name, or some integer constant.

Raises:

DataFormatError – If first_operand is not a valid signal name, if comparator is not a valid operation, or if second_operand is neither a valid signal name nor a constant.