RelayBoolAll¶
Defined in module: wield.declarative.callbacks.state_booleans.RelayBoolAll
- class RelayBoolAll(*args, **kwargs)[source][github]¶
Bases:
RelayBoolGateAnd/All gate for a collection of RelayBools
- __init__(relay_bools=(), **kwargs)[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)[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