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

Fixes for tesla. New sensors. #12225

Merged
merged 2 commits into from
Feb 8, 2018
Merged

Fixes for tesla. New sensors. #12225

merged 2 commits into from
Feb 8, 2018

Conversation

zabuldon
Copy link
Contributor

@zabuldon zabuldon commented Feb 7, 2018

Description: Fixes for tesla. New sensors.

Related issue (if applicable): fixes #11970

Checklist:

  • The code change is tested and works locally.

If the code communicates with devices, web services, or third-party tools:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.

@@ -10,7 +10,7 @@
from homeassistant.components.sensor import ENTITY_ID_FORMAT
from homeassistant.components.tesla import DOMAIN as TESLA_DOMAIN
from homeassistant.components.tesla import TeslaDevice
from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT
from homeassistant.const import TEMP_CELSIUS, TEMP_FAHRENHEIT, LENGTH_KILOMETERS, LENGTH_MILES

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

line too long (94 > 79 characters)

@zabuldon zabuldon changed the title fixes #11970 WIP: Fixes for tesla. New sensors. Feb 7, 2018
@zabuldon zabuldon changed the title WIP: Fixes for tesla. New sensors. Fixes for tesla. New sensors. Feb 7, 2018
@zabuldon zabuldon changed the title Fixes for tesla. New sensors. WIP: Fixes for tesla. New sensors. Feb 7, 2018
@zabuldon zabuldon changed the title WIP: Fixes for tesla. New sensors. Fixes for tesla. New sensors. Feb 7, 2018
@zabuldon zabuldon closed this Feb 7, 2018
@zabuldon zabuldon reopened this Feb 7, 2018
@balloob balloob merged commit 8523933 into home-assistant:dev Feb 8, 2018
@balloob
Copy link
Member

balloob commented Feb 8, 2018

Thanks! 🎉

@zabuldon zabuldon deleted the tesla_bug_11970 branch February 8, 2018 08:58
@balloob balloob mentioned this pull request Feb 9, 2018
@phithor
Copy link

phithor commented Feb 14, 2018

So how do I get the milage&/range in kilometres instead of Miles?
My Hass config is metric and my car units is obv. metric/kilometres. Running normal Home Assistant 0.63.2.
The milage/range shows in the equivalent length in miles with unit km. My car has run abot 60+k km but it shows 38k km.

@JoacimRC
Copy link

JoacimRC commented Mar 7, 2018

Thanks for fixing, but the fix seems to have removed the Battery level sensor. The two lines of code removed related to the Battery sensor makes the sensor update fail:

2018-03-07 20:12:35 ERROR (MainThread) [homeassistant.components.sensor] tesla: Error on device update!
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 197, in _async_add_entity
    yield from entity.async_device_update(warning=False)
  File "/usr/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 327, in async_device_update
    yield from self.hass.async_add_job(self.update)
  File "/usr/lib/python3.6/asyncio/futures.py", line 332, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.6/asyncio/tasks.py", line 250, in _wakeup
    future.result()
  File "/usr/lib/python3.6/asyncio/futures.py", line 245, in result
    raise self._exception
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/sensor/tesla.py", line 82, in update
    self.current_value = self.tesla_device.get_value()
AttributeError: 'Battery' object has no attribute 'get_value'

@MartinHjelmare
Copy link
Member

@JoacimRC please open an issue.

@home-assistant home-assistant locked and limited conversation to collaborators Jul 26, 2018
@ghost ghost removed the platform: sensor.tesla label Mar 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

All Tesla component updates fail if single vehicle unavailable
7 participants