Skip to content

Commit

Permalink
Merge pull request #2 from wenwenchenbosch/test
Browse files Browse the repository at this point in the history
fix some issues and remove some signal
  • Loading branch information
wenwenchenbosch authored Apr 14, 2021
2 parents 7ff1a46 + bc8a15d commit c169336
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 82 deletions.
78 changes: 0 additions & 78 deletions mapping.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,84 +44,6 @@ THROTTLE_POS:
unit:
- percent

THROTTLE_POS_B:
targets:
- Vehicle.OBD.ThrottlePositionB
unit:
- percent

THROTTLE_POS_C:
targets:
- Vehicle.OBD.ThrottlePositionC
unit:
- percent

ACCELERATOR_POS_D:
targets:
- Vehicle.OBD.AcceleratorPositionD
unit:
- percent

ACCELERATOR_POS_E:
targets:
- Vehicle.OBD.AcceleratorPositionE
unit:
- percent

ACCELERATOR_POS_F:
targets:
- Vehicle.OBD.AcceleratorPositionF
unit:
- percent

O2_B1S1:
targets:
- Vehicle.OBD.O2.Bank1.Sensor1.Voltage
unit:
- volt

O2_B1S2:
targets:
- Vehicle.OBD.O2.Bank1.Sensor2.Voltage
unit:
- volt

O2_B1S3:
targets:
- Vehicle.OBD.O2.Bank1.Sensor3.Voltage
unit:
- volt

O2_B1S4:
targets:
- Vehicle.OBD.O2.Bank1.Sensor4.Voltage
unit:
- volt

O2_B2S1:
targets:
- Vehicle.OBD.O2.Bank1.Sensor1.Voltage
unit:
- volt

O2_B2S2:
targets:
- Vehicle.OBD.O2.Bank1.Sensor2.Voltage
unit:
- volt

O2_B2S3:
targets:
- Vehicle.OBD.O2.Bank1.Sensor3.Voltage
unit:
- volt

O2_B2S4:
targets:
- Vehicle.OBD.O2.Bank1.Sensor4.Voltage
unit:
- volt

DISTANCE_W_MIL:
targets:
- Vehicle.OBD.DistanceWithMIL
Expand Down
8 changes: 4 additions & 4 deletions obdfeeder.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ def __init__(self, config):
self.connection = obdC.openOBD(self.cfg['device'], self.cfg['baudrate'])
self.thread.start()

def publishData():
def publishData(self):
print("Publish data")
for obdval,config in mapping.map():
for obdval,config in self.mapping.map():

if config['value'] is None:
continue
print("Publish {}: to ".format(obdval), end='')
for path in config['targets']:
self.vssclient.setValue(path, config['value'].magnitude)
self.vssClient.setValue(path, config['value'].magnitude)
print(path, end=' ')
print("")

def loop(self):
print("obd loop started")
while True:
obdC.collectData(mapping, self.connection)
obdC.collectData(self.mapping, self.connection)
self.publishData()
# response=connection.query(cmd)
# if not response.is_null():
Expand Down

0 comments on commit c169336

Please sign in to comment.