Skip to content

Commit

Permalink
Merge 0f63039 into 5ca622c
Browse files Browse the repository at this point in the history
  • Loading branch information
rikroe authored Jun 17, 2020
2 parents 5ca622c + 0f63039 commit 75f8a56
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions bimmer_connected/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,17 @@ def update_data(self) -> None:
'dlat': self._vehicle.observer_latitude,
'dlon': self._vehicle.observer_longitude,
}
response = self._account.send_request(
VEHICLE_STATUS_URL.format(server=self._account.server_url, vin=self._vehicle.vin), logfilename='status',
params=params)
attributes = response.json()['vehicleStatus']
# Pre-NBT vehicles don't seem to have a status that can be reported
try:
response = self._account.send_request(
VEHICLE_STATUS_URL.format(server=self._account.server_url, vin=self._vehicle.vin), logfilename='status',
params=params)
attributes = response.json()['vehicleStatus']
_LOGGER.debug('received new data from connected drive')
except OSError:
attributes = {}
_LOGGER.debug('Unable to retrieve vehicle status from connected drive (car too old)')
self._attributes = attributes
_LOGGER.debug('received new data from connected drive')

@property
@backend_parameter
Expand Down

0 comments on commit 75f8a56

Please sign in to comment.