BF: optical was reporting incorrect values caused by NACK byte (Valentin Haenel)

also brought optical code in line with PEP8