circuit_condition
- class CircuitConditionMixin
(Implicitly inherits
ControlBehaviorMixin
)Allows the Entity to have an circuit enable condition, such as when the value of some signal exceeds some constant.
- remove_circuit_condition() None
Removes the circuit condition of the Entity. Does nothing if the Entity has no circuit condition to remove.
- set_circuit_condition(a: str | None = None, cmp: str = '<', b: str | int = 0) None
Sets the circuit condition of the Entity.
cmp
can be specified as stored as the single unicode character which is used by Factorio, or you can use the Python formatted 2-character equivalents:# One of: [">", "<", "=", "≥", "≤", "≠"] # Or, alternatively: [">", "<", "==", ">=", "<=", "!="]
If specified in the second format, they are converted to and stored as the first format.
- Parameters:
a – The string name of the first signal.
cmp – The operation to use, as specified above.
b – The string name of the second signal, or some 32-bit constant.
- Raises:
DataFormatError – If
a
is not a valid signal name, ifcmp
is not a valid operation, or ifb
is neither a valid signal name nor a constant.