Merge pull request #1914 from robbiet480/uber-metered-fix

Uber: Dont load price sensors for metered (read: taxi/cabs) products
pull/1934/merge
Robbie Trencheny 2016-04-28 17:57:59 -07:00
commit abc00c76bc
1 changed files with 2 additions and 1 deletions

View File

@ -47,7 +47,8 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
(product_id not in wanted_product_ids):
continue
dev.append(UberSensor('time', timeandpriceest, product_id, product))
if 'price_details' in product:
is_metered = (product['price_details']['estimate'] == "Metered")
if 'price_details' in product and is_metered is False:
dev.append(UberSensor('price', timeandpriceest,
product_id, product))
add_devices(dev)