Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in Uber platform when 'estimate' not returned via the API call #3721

Closed
Old-Man-River opened this issue Oct 6, 2016 · 3 comments · Fixed by #8428
Closed

Error in Uber platform when 'estimate' not returned via the API call #3721

Old-Man-River opened this issue Oct 6, 2016 · 3 comments · Fixed by #8428

Comments

@Old-Man-River
Copy link

Old-Man-River commented Oct 6, 2016

Home Assistant release (hass --version):
0.29.7

Python release (python3 --version):
Python 3.5.2

Component/platform:
uber

Description of problem:

When estimate is not set in price_details this error is thrown and its fatal, sensor data is not shown for time estimate on States page.

16-10-05 21:56:15 homeassistant.components.sensor: Error while setting up platform uber Traceback (most recent call last): File "/opt/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 107, in _setup_platform discovery_info) File "/opt/homeassistant/lib/python3.5/site-packages/homeassistant/components/sensor/uber.py", line 62, in setup_platform product['price_details']['estimate'] is not 'Metered': KeyError: 'estimate'

Expected:

Even if a price estimate is not available the time estimate should still be displayed.

Problem-relevant configuration.yaml entries and steps to reproduce:

- platform: uber
  start_latitude: 35.7811
  start_longitude: -78.7665
  server_token: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXX'   
  product_ids:
   - '7f4c7355-03db-4d78-8fba-63ac4813ad77'

Additional info:

I have not tried setting the optional destination ( end lat and long ) to see if the estimate value is populated, I would imagine that wilI be. I commented out line numbers 61-64 as a workaround but will probably just hack it to check if ['price_details']['estimate'] is set before executing the rest of that block of code.

@mariniertje
Copy link

mariniertje commented Feb 17, 2017

This issue still exists in v0.38.3

The whole Uber component is not showing, because of the error thrown.

Feb 17 12:20:51 raspberrypi hass[9702]: File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/sensor/uber.py", line 61, in setup_platform
Feb 17 12:20:51 raspberrypi hass[9702]: product['price_details']['estimate'] is not 'Metered':
Feb 17 12:20:51 raspberrypi hass[9702]: KeyError: 'estimate'

My config looks like this:

### ORDER SERVICES ###
- platform: uber
  server_token: '<secret-servertoken>'
  start_latitude: 37.696973
  start_longitude: -122.069722
  product_ids:
    ## ECONOMY
    # Uber POOL
    - 'ee3ab307-e340-4406-b5ec-9f8c3b43075a'
    # Uber X
    - '04a497f5-380d-47f2-bf1b-ad4cfdcb51f2'
    ## PREMIUM
    # Uber SELECT
    - '57c0ff4e-1493-4ef9-a4df-6b961525cf92'
    # Uber BLACK - The Original
    - 'd4abaae7-f4d6-4152-91cc-77523e8165a4'
    ## EXTRA SEATS
    # Uber XL
    - 'b5e6755e-05dd-44cc-903d-94bdaa7ffc78'
    # SUV - Room for Everyone
    - '8920cb5e-51a4-4fa4-acdf-dd86c5e18ae0'
    ## MORE
    # UberX - Extra Assistance
    - '4057d8cc-f0f5-43fa-b448-1cd891b0fc66'
    # UberX - Wheelchair Accessible
    - '2832a1f5-cfc0-48bb-ab76-7ea7a62060e7'
```

@balloobbot
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.

Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍

@mariniertje
Copy link

Still experience this same issue in 0.41.0.

Will try updating to latest version later this week. But since 0.42 introduced more issues, I rolled back to 0.41

fabaff added a commit that referenced this issue Jul 10, 2017
@balloob balloob mentioned this issue Jul 13, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Oct 20, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants