Skip to content

Commit

Permalink
Fixing small bug when fuelEconomy is missing from response.
Browse files Browse the repository at this point in the history
  • Loading branch information
niklascp committed Mar 9, 2021
1 parent fe7c1c5 commit 87edfa0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
__pycache__/
env/
.env/
build/
dist/
*.egg-info/
Expand Down
2 changes: 1 addition & 1 deletion connectedcars/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def create_from_dict(cls, dict):
vehicle.make = str(dict['make'])
vehicle.model = str(dict['model'])
vehicle.name = str(dict['name'])
vehicle.fuelEconomy = float(dict['fuelEconomy'])
vehicle.fuelEconomy = float(dict['fuelEconomy']) if dict['fuelEconomy'] is not None else None

if dict['position'] is not None:
vehicle.position = VehiclePosition.create_from_dict(dict['position'])
Expand Down
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@
setup(
name = 'connectedcars',
packages = ['connectedcars'],
version = '0.1.3',
version = '0.1.5',
license = 'MIT',
description = 'Wrapper for access the Connected Cars API - an AVL/data collection service installed in most new danish vehicles from Audi, Volkswagen, Skoda and SEAT.',
long_description = long_description,
long_description_content_type = 'text/markdown',
author = 'Niklas Christoffer Petersen',
author_email = '[email protected]',
url = 'https://github.com/niklascp/connectedcars-python',
download_url = 'https://github.com/niklascp/connectedcars-python/archive/v0.1.0.tar.gz',
download_url = 'https://github.com/niklascp/connectedcars-python/archive/v0.1.4.tar.gz',
keywords = ['AVL', 'Audi', 'Volkswagen', 'Skoda', 'SEAT'],
install_requires = install_requires,
classifiers = [
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
],
)

0 comments on commit 87edfa0

Please sign in to comment.