I’m afraid I don’t have access to a sensor to test but I think it’s probably line 17 that is causing you grief.
I think all you need to do to fix this line is change it to
ser.write(b”\xFE\x44\x00\x08\x02\x9F\x25″)
Lines 24 & 25 may also need changing, but without the hardware I can’t test.