finally found a working solution for on_device callback, see comment in zway.pyx