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

Uber ride will fail to setup if no product id is set #8401

Closed
enriquegh opened this issue Jul 8, 2017 · 4 comments · Fixed by #8438
Closed

Uber ride will fail to setup if no product id is set #8401

enriquegh opened this issue Jul 8, 2017 · 4 comments · Fixed by #8438
Assignees

Comments

@enriquegh
Copy link
Contributor

Make sure you are running the latest version of Home Assistant before reporting an issue.

You should only file an issue if you found a bug. Feature and enhancement requests should go in the Feature Requests section of our community forum:

Home Assistant release (hass --version):
0.48.1

Python release (python3 --version):
3.4.2

Component/platform:
sensor.uber

Description of problem:
When using the uber sensor and not specifying any product ids (get all products), the sensor will throw an error and not work.

Expected:

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

sensor:

  - platform: uber
    server_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    start_longitude: xxx.xxxxxxx
    start_latitude: xx.xxxxxxx
    end_longitude: xxx.xxxxxx
    end_latitude: xx.xxxxxx
  1. Set logger homeassistant.components.sensor to debug
  2. Start home assistant
  3. Will see error on log

Traceback (if applicable):

2017-07-07 16:34:57 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform uber
Traceback (most recent call last):
  File "/srv/hass/lib/python3.4/site-packages/homeassistant/helpers/entity_component.py", line 164, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=self.hass.loop)
  File "/usr/lib/python3.4/asyncio/tasks.py", line 372, in wait_for
    return fut.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/hass/lib/python3.4/site-packages/homeassistant/components/sensor/uber.py", line 63, in setup_platform
    'price', timeandpriceest, product_id, product))
  File "/srv/hass/lib/python3.4/site-packages/homeassistant/components/sensor/uber.py", line 90, in __init__
    self._state = int(price_details.get(statekey, 0))
TypeError: int() argument must be a string or a number, not 'NoneType'

Additional info:

Avoiding the TAXI product which has a "low_estimate" value of None seems to fix this but you can't know this without digging deep into the responses received from Uber


@enriquegh
Copy link
Contributor Author

related to #7241

@fabaff
Copy link
Member

fabaff commented Jul 10, 2017

Can not be reproduced without configuration as not all products are available everywhere.

@enriquegh
Copy link
Contributor Author

Hey @fabaff this was made in SF so the following config should make this error pop up

sensor:

  - platform: uber
    server_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    start_longitude: -122.420443
    start_latitude: 37.780248
    end_longitude: -122.393289
    end_latitude: 37.795833

I'm not sure if this helps but the TAXI product id is: d4abaae7-f4d6-4152-91cc-77523e8165a4

Let me know if there's any other info I can give you.

fabaff added a commit that referenced this issue Jul 11, 2017
@fabaff
Copy link
Member

fabaff commented Jul 11, 2017

Thanks for your support, @enriquegh.

@fabaff fabaff self-assigned this Jul 11, 2017
@balloob balloob mentioned this issue Jul 13, 2017
dethpickle pushed a commit to dethpickle/home-assistant that referenced this issue Aug 18, 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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants