logistic_condition

class LogisticConditionMixin(
connect_to_logistic_network: bool = False,
logistic_condition: Any = NOTHING,
*,
extra_keys: dict[str, Any] | None = None,
)

Allows the Entity to have an logistic enable condition, such as when the amount of some item in the logistic network exceeds some constant.

connect_to_logistic_network : bool

Serialized

This attribute is imported/exported from blueprint strings.

Whether or not this entity should connect to the logistic network it resides in.

logistic_condition : Condition

Serialized

This attribute is imported/exported from blueprint strings.

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

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

Sets the logistic 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 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:
first_operand: SignalID | None = None

The string name of the first signal.

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

The operation to use, as specified above.

second_operand: SignalID | int = 0

The string name of the second signal, or some 32-bit 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.