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

Added resolve_state to template distance function #17290

Merged
merged 1 commit into from Oct 10, 2018

Conversation

mnigbur
Copy link
Contributor

@mnigbur mnigbur commented Oct 9, 2018

Description:

_resolve_state was already used in the "closest" function, to allow for states and entity ids.
Added tests for the "new" functionality.

Related issue (if applicable): fixes #17178

Example template:

{{ distance('device_tracker.anne_therese', 'device_tracker.paulus') }}

Checklist:

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

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

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • [x ] New dependencies are only imported inside functions that use them (example).
  • New or updated 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.

_resolve_state was already used in the "closest" function, to allow for states and entity ids
@mnigbur mnigbur requested a review from a team as a code owner October 9, 2018 18:11
@ghost ghost added the in progress label Oct 9, 2018
@balloob balloob merged commit 670c75e into home-assistant:dev Oct 10, 2018
@ghost ghost removed the in progress label Oct 10, 2018
@balloob
Copy link
Member

balloob commented Oct 10, 2018

Awesome!

@mnigbur mnigbur deleted the distance-entity-fix branch October 10, 2018 10:26
@balloob balloob mentioned this pull request Oct 26, 2018
@home-assistant home-assistant locked and limited conversation to collaborators Feb 5, 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.

distance() documentation incorrect, or a bug?
3 participants