One may want to connect to the Dice just for reading its properties without listening to flip events. In this case an exception below gets thrown when the Dice is flipped during connection time without a custom handler attached:
Discovering GoDice devices...
Discovered devices...
Connecting to a closest device...
Connected to GoDice_XXXXXX
Color: Color.BLUE
Battery: 89
Task exception was never retrieved
future: <Task finished name='Task-9' coro=<Dice._handle_upd() done, defined at /home/bman/Documents/dev/sandbox/learnlib-py/GoDicePythonAPI/godice/dice.py:129> exception=TypeError('Dice.__init__.<locals>.<lambda>() takes 1 positional argument but 2 were given')>
Traceback (most recent call last):
File "/home/bman/Documents/dev/sandbox/learnlib-py/GoDicePythonAPI/godice/dice.py", line 163, in _handle_upd
await self._position_upd_cb(rolled_value, descr)
TypeError: Dice.__init__.<locals>.<lambda>() takes 1 positional argument but 2 were given
One may want to connect to the Dice just for reading its properties without listening to flip events. In this case an exception below gets thrown when the Dice is flipped during connection time without a custom handler attached: