mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 06:37:52 +00:00
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:
parent
60b427accc
commit
55daf51108
@ -72,7 +72,7 @@ class UberSensor(Entity):
|
|||||||
time_estimate = self._product.get('time_estimate_seconds', 0)
|
time_estimate = self._product.get('time_estimate_seconds', 0)
|
||||||
self._state = int(time_estimate / 60)
|
self._state = int(time_estimate / 60)
|
||||||
elif self._sensortype == "price":
|
elif self._sensortype == "price":
|
||||||
price_details = self._product.get('price_details', {})
|
price_details = self._product.get('price_details')
|
||||||
if price_details is not None:
|
if price_details is not None:
|
||||||
self._unit_of_measurement = price_details.get('currency_code',
|
self._unit_of_measurement = price_details.get('currency_code',
|
||||||
'N/A')
|
'N/A')
|
||||||
@ -207,7 +207,7 @@ class UberEstimate(object):
|
|||||||
|
|
||||||
for price in prices:
|
for price in prices:
|
||||||
product = self.products[price['product_id']]
|
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["duration"] = price.get('duration', '0')
|
||||||
product["distance"] = price.get('distance', '0')
|
product["distance"] = price.get('distance', '0')
|
||||||
if price_details is not None:
|
if price_details is not None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user