Resync BPM with Python

How do I resync the BPM to the first beat without pressing the button in the Beat Dialogue. In other words, what does this button do in the background? I could only find the op(‘/local/time’).tempo function.

Thanks,

Emil

It’s a bit of a workaround, but if you change the value in
/local/time/set_state tapcount, then the beat will reset.
Needs a cleaner solution overall though.