From 8fdd9712e62a0eb38ea04a2dedd3ad255a17e327 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sun, 27 Aug 2017 11:31:06 +0200 Subject: [PATCH] Upgrade uber_rides to 0.5.2 (#9149) --- homeassistant/components/sensor/uber.py | 15 +++++++++------ requirements_all.txt | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/sensor/uber.py b/homeassistant/components/sensor/uber.py index 5d8ff49cd5b..eb7050309bc 100644 --- a/homeassistant/components/sensor/uber.py +++ b/homeassistant/components/sensor/uber.py @@ -14,7 +14,7 @@ from homeassistant.components.sensor import PLATFORM_SCHEMA from homeassistant.helpers.entity import Entity from homeassistant.util import Throttle -REQUIREMENTS = ['uber_rides==0.5.1'] +REQUIREMENTS = ['uber_rides==0.5.2'] _LOGGER = logging.getLogger(__name__) @@ -87,11 +87,14 @@ class UberSensor(Entity): if self._product.get('price_details') is not None: price_details = self._product['price_details'] self._unit_of_measurement = price_details.get('currency_code') - if price_details.get('low_estimate') is not None: - statekey = 'minimum' - else: - statekey = 'low_estimate' - self._state = int(price_details.get(statekey, 0)) + try: + if price_details.get('low_estimate') is not None: + statekey = 'minimum' + else: + statekey = 'low_estimate' + self._state = int(price_details.get(statekey)) + except TypeError: + self._state = 0 else: self._state = 0 diff --git a/requirements_all.txt b/requirements_all.txt index 920c5880813..828de6e08c6 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -954,7 +954,7 @@ transmissionrpc==0.11 twilio==5.7.0 # homeassistant.components.sensor.uber -uber_rides==0.5.1 +uber_rides==0.5.2 # homeassistant.components.sensor.ups upsmychoice==1.0.6