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

Expose specific device_class for Velux covers #24279

Merged
merged 4 commits into from
Jun 4, 2019

Conversation

gibman
Copy link
Contributor

@gibman gibman commented Jun 3, 2019

Blinds, Rollingshutters and Awnings did not set their respective device_class attribute
Previously they would all appear as device_class "window"

Breaking Change:

Description:

Related issue (if applicable): fixes #

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

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
  • There is no commented out code in this PR.
  • I have followed the development checklist

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

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

  • The manifest file has all fields filled out correctly. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

If the code does not interact with devices:

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

Blinds, Rollingshutters and Awnings did not set their respective device_class attribute
Previously they would all appear as device_class "window"
@ghost
Copy link

ghost commented Jun 3, 2019

Hey there @Julius2342, mind taking a look at this pull request as its been labeled with a integration (velux) you are listed as a codeowner for? Thanks!

This is a automatic comment generated by codeowners-mention to help ensure issues and pull requests are seen by the right people.

@gibman gibman changed the title Update cover.py Expose specific device_class for Velux covers Jun 3, 2019
if isinstance(self.node, RollerShutter):
return 'shutter'
if isinstance(self.node, Awning):
return 'awning'
Copy link
Member

Choose a reason for hiding this comment

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

I think this should have an explicit return None at the end in case none of the if cases match

fallback device class is always 'window' in the event we have an unknown cover type
@Julius2342
Copy link
Contributor

The pipeline is blocked bc of two trivial linter errors:

homeassistant/components/velux/cover.py:63:80: E501 line too long (81 > 79 characters)
homeassistant/components/velux/cover.py:63:82: W291 trailing whitespace

@gibman : may you change them?

@balloob balloob merged commit 6d28008 into home-assistant:dev Jun 4, 2019
@gibman gibman deleted the velux-device_class branch June 6, 2019 13:51
@balloob balloob mentioned this pull request Jun 26, 2019
alandtse pushed a commit to alandtse/home-assistant that referenced this pull request Oct 12, 2019
* Update cover.py

Blinds, Rollingshutters and Awnings did not set their respective device_class attribute
Previously they would all appear as device_class "window"

* fallback device class is always 'window'

fallback device class is always 'window' in the event we have an unknown cover type

* trailing whitespace removed, trimmed as well

* Update cover.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants