Dont set default value for price_details to empty dict since we want to check price_details for is None

This commit is contained in:
Robbie Trencheny 2016-03-29 20:42:15 -07:00
parent 60b427accc
commit 55daf51108

View file

@ -72,7 +72,7 @@ class UberSensor(Entity):
time_estimate = self._product.get('time_estimate_seconds', 0)
self._state = int(time_estimate / 60)
elif self._sensortype == "price":
price_details = self._product.get('price_details', {})
price_details = self._product.get('price_details')
if price_details is not None:
self._unit_of_measurement = price_details.get('currency_code',
'N/A')
@ -207,7 +207,7 @@ class UberEstimate(object):
for price in prices:
product = self.products[price['product_id']]
price_details = product.get("price_details", {})
price_details = product.get("price_details")
product["duration"] = price.get('duration', '0')
product["distance"] = price.get('distance', '0')
if price_details is not None: