Upgrade uber_rides to 0.5.2 (#9149)

This commit is contained in:
Fabian Affolter 2017-08-27 11:31:06 +02:00 committed by GitHub
parent f47de06f02
commit 8fdd9712e6
2 changed files with 10 additions and 7 deletions

View File

@ -14,7 +14,7 @@ from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle from homeassistant.util import Throttle
REQUIREMENTS = ['uber_rides==0.5.1'] REQUIREMENTS = ['uber_rides==0.5.2']
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -87,11 +87,14 @@ class UberSensor(Entity):
if self._product.get('price_details') is not None: if self._product.get('price_details') is not None:
price_details = self._product['price_details'] price_details = self._product['price_details']
self._unit_of_measurement = price_details.get('currency_code') self._unit_of_measurement = price_details.get('currency_code')
if price_details.get('low_estimate') is not None: try:
statekey = 'minimum' if price_details.get('low_estimate') is not None:
else: statekey = 'minimum'
statekey = 'low_estimate' else:
self._state = int(price_details.get(statekey, 0)) statekey = 'low_estimate'
self._state = int(price_details.get(statekey))
except TypeError:
self._state = 0
else: else:
self._state = 0 self._state = 0

View File

@ -954,7 +954,7 @@ transmissionrpc==0.11
twilio==5.7.0 twilio==5.7.0
# homeassistant.components.sensor.uber # homeassistant.components.sensor.uber
uber_rides==0.5.1 uber_rides==0.5.2
# homeassistant.components.sensor.ups # homeassistant.components.sensor.ups
upsmychoice==1.0.6 upsmychoice==1.0.6