You can call if (gps.speed.isValid() ) {…}
if (gps.speed.isValid() ) {…}
It’s just a guess based on the previous 1s interval acceleration (the delta in speed over one second) of course you can’t predict when the driver will stop that current behavior (accelerating or slowing down).