This repository has been archived by the owner on Aug 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 162
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Linted Python With Pep8
- Loading branch information
Showing
2 changed files
with
29 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,34 @@ | ||
#!/usr/bin/env python | ||
import sys | ||
import time | ||
import obd | ||
import json | ||
import os | ||
import curses | ||
|
||
|
||
if len(sys.argv) == 1: | ||
connection = obd.OBD() | ||
else: | ||
connection = obd.OBD(sys.argv[1]) # First arg is the device to connect to | ||
connection = obd.OBD(sys.argv[1]) | ||
|
||
curses.setupterm() | ||
sys.stdout.write(curses.tigetstr("clear")) | ||
sys.stdout.flush() | ||
os.system('clear') | ||
|
||
while True: | ||
print 'Car Information: ' | ||
print 'Speed : ' + str(connection.query(obd.commands.SPEED).value.to("mph")) | ||
print 'RPM : ' + str(connection.query(obd.commands.RPM).value) | ||
print 'Fuel Level: ' + str(connection.query(obd.commands.FUEL_LEVEL).value) | ||
print 'Engine Temp : ' + str(connection.query(obd.commands.COOLANT_TEMP).value.to("degF")) | ||
print '\n' | ||
print 'Diagonstic Information: ' | ||
print 'Stored DTCs: ' + str(connection.query(obd.commands.GET_DTC).value) | ||
print 'UpTme: ' + str(connection.query(obd.commands.RUN_TIME).value) | ||
print '\n' | ||
print 'Weather Information:' | ||
print 'Air Temp: ' + str(connection.query(obd.commands.AMBIANT_AIR_TEMP).value.to("degF")) | ||
print 'Barometric Pressure: ' + str(connection.query(obd.commands.BAROMETRIC_PRESSURE).value) | ||
time.sleep(5) | ||
curses.setupterm() | ||
sys.stdout.write(curses.tigetstr("clear")) | ||
sys.stdout.flush() | ||
|
||
print 'Car Information: ' | ||
print 'Speed : ' + \ | ||
str(connection.query(obd.commands.SPEED).value.to("mph")) | ||
print 'RPM : ' + str(connection.query(obd.commands.RPM).value) | ||
print 'Fuel Level: ' + str(connection.query(obd.commands.FUEL_LEVEL).value) | ||
print 'Engine Temp : ' + \ | ||
str(connection.query(obd.commands.COOLANT_TEMP).value.to("degF")) | ||
print '\n' | ||
print 'Diagonstic Information: ' | ||
print 'Stored DTCs: ' + str(connection.query(obd.commands.GET_DTC).value) | ||
print 'UpTme: ' + str(connection.query(obd.commands.RUN_TIME).value) | ||
print '\n' | ||
print 'Weather Information:' | ||
print 'Air Temp: ' \ | ||
+ str(connection.query(obd.commands.AMBIANT_AIR_TEMP).value.to("degF")) | ||
print 'Barometric Pressure: ' \ | ||
+ str(connection.query(obd.commands.BAROMETRIC_PRESSURE).value) | ||
time.sleep(5) | ||
os.system('clear') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters