RelayBoolGate¶
Defined in module: wield.declarative.callbacks.state_booleans.RelayBoolGate
- class RelayBoolGate(*args, **kwargs)[source][github]¶
Bases:
RelayBoolBase,ReprMixinBase class to implement the logic needed for syncronous action of logic gates of RelayBools.
These gates are all based on monitoring sub-bools using a count. Subclasses set the values of
- __init__(relay_bools=(), **kwargs)[source][github]¶
- Parameters:
relay_bools – iterable of Relays Bools to set up initial gate value
Methods
__init__([relay_bools])bool_register(relay_bool[, name, remove])bool_unregister(relay_bool[, name])register([key, callback, assumed_value, ...])Register a function for callback when this bool's state changes.
register_via(reg_call, callback[, key, remove])Attributes
Returns T/F status of the bool
- register(key=None, callback=None, assumed_value=('<UNIQUE VALUE>', <function unique_generator.<locals>.UNIQUE_CLOSURE>), call_immediate=False, remove=False)[source][github]¶
Register a function for callback when this bool’s state changes.
- Parameters:
callback – function to register
call_immediate – call as the function is added
remove – (False) set to remove a callback
- Raises:
KeyErroron missing callback
The function should have the signature
- callback(bool_state):
- Parameters:
bool_state – state of the RelayBool’s new value