In the `state_lines` you reference the value directly from `ret` so it looks like these local assignments of `start_time` & `duration` are not used.

Is this left over from testing/implementation -- or am I missing where they're used?

So glad to see that this got added, it will be a great addition!