Dont load price sensors for metered (read: taxi/cabs) products

This commit is contained in:
Robbie Trencheny 2016-04-25 11:43:18 -07:00
parent 69daa383dd
commit ee9996374c

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:
isMetered = (product['price_details']['estimate'] == "Metered")
if 'price_details' in product and isMetered is False:
dev.append(UberSensor('price', timeandpriceest,
product_id, product))
add_devices(dev)