Skip to content

Fixing Tesla sensors to display km#13427

Merged
balloob merged 1 commit intohome-assistant:devfrom
alandtse:teslaupdates
Mar 25, 2018
Merged

Fixing Tesla sensors to display km#13427
balloob merged 1 commit intohome-assistant:devfrom
alandtse:teslaupdates

Conversation

@alandtse
Copy link
Copy Markdown
Contributor

Description:

Corrects odometer and range sensors to display km

Related issue (if applicable): fixes #13263

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.github.io#<home-assistant.github.io PR number goes here>
N/A

Example entry for configuration.yaml (if applicable):

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

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

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@homeassistant homeassistant added platform: sensor.tesla small-pr PRs with less than 30 lines. labels Mar 24, 2018
@alandtse alandtse changed the title Fixing Tesla odometer to display km Fixing Tesla sensors to display km Mar 24, 2018
Copy link
Copy Markdown
Contributor

@smurfix smurfix left a comment

Choose a reason for hiding this comment

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

Doesn't the same problem exist a few lines above your change, with °F vs. °C?

@alandtse
Copy link
Copy Markdown
Contributor Author

@smurfix It might. I didn't do any of the climate part.

However, I just did a test and it doesn't appear like the sensor is switching to Celsius so there may be additional issues with it.

@balloob balloob merged commit 3a76569 into home-assistant:dev Mar 25, 2018
self._unit = LENGTH_MILES
else:
self._unit = LENGTH_KILOMETERS
self.current_value /= 0.621371
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We have a converter for this in util.distance.py.

@balloob balloob mentioned this pull request Apr 13, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Jul 26, 2018
@ghost ghost added integration: tesla removed integration and removed platform: sensor.tesla labels Mar 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla-signed integration: tesla removed integration small-pr PRs with less than 30 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tesla component range and mileage is only miles not km

6 participants