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

Conversation

Projects
None yet
5 participants
@tjorim
Contributor

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.

tjorim added some commits Nov 7, 2018

Show correct name
Constants in alphabetical order.
Added default name when not showing the local/current version.

@tjorim tjorim requested review from armills, cdce8p, Danielhiversen, fabaff, Kane610, kellerza, rytilahti, syssi and home-assistant/core as code owners Nov 7, 2018

@wafflebot wafflebot bot added the in progress label Nov 7, 2018

@tjorim tjorim changed the base branch from rc to dev Nov 7, 2018

Add icon
Icon was already defined but not set

@tjorim tjorim referenced this pull request Nov 7, 2018

Merged

Fix default name for version #7409

2 of 2 tasks complete

@tjorim tjorim changed the title from WIP: Improve version sensor to Improve version sensor Nov 7, 2018

@fabaff fabaff added this to the 0.82 milestone Nov 7, 2018

@fabaff

fabaff approved these changes Nov 7, 2018

Thanks 🐦

@fabaff

This comment has been minimized.

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

This comment has been minimized.

Contributor

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

5 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.002%) to 93.053%
Details

@wafflebot wafflebot bot removed the in progress label Nov 7, 2018

zxdavb added a commit to zxdavb/home-assistant that referenced this pull request Nov 13, 2018

Improve version sensor (home-assistant#18292)
* Validate value against valid list

* Show correct name

Constants in alphabetical order.
Added default name when not showing the local/current version.

* Add icon

Icon was already defined but not set

* Unnecessary "elif" after "return" (no-else-return)

@balloob balloob referenced this pull request Nov 29, 2018

Merged

0.83 #18776

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment