Move __main__ sensor code