Closed domire8 closed 4 months ago
The changes to read_until
were intentional, but the return type of the calling wait_for
functions was not intended to change. The wait_for
functions should still return True or False depending on if the waiting ended before the timeout or not.
The reason it wasn't caught is that None
and a wellformed dict
are respectively falsey and truthy when evaluated in a boolean condition such as:
if wait_for_component(...):
# do something if true
else:
# do something if false
This can be made more explicitly into a boolean return type using return read_until(...) is not None
.
I will also use this issue as a springboard to add wait_for_hardware
, wait_for_controller
and wait_for_controller_predicate
, since they are not currently represented.
https://github.com/aica-technology/api/blob/1416d892dfdab0d2ceeb6a5b8b7733b6a13dda7d/python/src/aica_api/client.py#L279
@eeberhard since #95, the python client
wait_for...
functions returnUnion[None,dict]
instead of bool. Is this an oversight or is there a reason for it?@yrh012