From 55daf51108ec9781962ecd286ac27b7acdbeaeca Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Tue, 29 Mar 2016 20:42:15 -0700 Subject: [PATCH] Dont set default value for price_details to empty dict since we want to check price_details for is None --- homeassistant/components/sensor/uber.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/sensor/uber.py b/homeassistant/components/sensor/uber.py index 948a9240ec2..59c1c50f85c 100644 --- a/homeassistant/components/sensor/uber.py +++ b/homeassistant/components/sensor/uber.py @@ -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: