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

Improve version sensor #18292

Merged
merged 4 commits into from Nov 7, 2018
Merged

Improve version sensor #18292

merged 4 commits into from Nov 7, 2018

Conversation

tjorim
Copy link
Contributor

@tjorim tjorim commented Nov 7, 2018

Description:

This PR builds on the updated version sensor (#18067). It improves validation and adds a name that makes sense with the new functionality.

Currently it always shows 'Current Version' as name, which is confusing when using the component to check the latest version available.

I think this is not a breaking change, but maybe someone can verify (@ludeeus reminded me the entity_id is linked to the name):

  • If a user specified a custom name before it still uses that one
  • If a user is not using the new functionality it still has the same default value

Edit: this now also sets the icon property which was forgotten

Related issue (if applicable): fixes # NA

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#7409

should be cherry-picked for the beta 0.82 release

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

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 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.

Constants in alphabetical order.
Added default name when not showing the local/current version.
@tjorim tjorim requested a review from a team November 7, 2018 01:52
@tjorim tjorim requested a review from a team as a code owner November 7, 2018 01:52
@ghost ghost added the in progress label Nov 7, 2018
@tjorim tjorim changed the base branch from rc to dev November 7, 2018 01:52
Icon was already defined but not set
@tjorim tjorim changed the title WIP: Improve version sensor Improve version sensor Nov 7, 2018
@fabaff fabaff added this to the 0.82 milestone Nov 7, 2018
Copy link
Member

@fabaff fabaff left a comment

Choose a reason for hiding this comment

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

Thanks 🐦

@fabaff
Copy link
Member

fabaff commented Nov 7, 2018

Can be merged if CI passes.

@balloob balloob removed this from the 0.82 milestone Nov 7, 2018
@tjorim
Copy link
Contributor Author

tjorim commented Nov 7, 2018

It's fixed now, Travis hasn't started here yet but succeeded on my personal repo.

@Danielhiversen Danielhiversen merged commit 29be78e into home-assistant:dev Nov 7, 2018
@ghost ghost removed the in progress label Nov 7, 2018
@balloob balloob mentioned this pull request Nov 29, 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.

None yet

5 participants