-
-
Notifications
You must be signed in to change notification settings - Fork 37.4k
Add support for Velux Gates #34774
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
Add support for Velux Gates #34774
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| """Support for Velux covers.""" | ||
| from pyvlx import OpeningDevice, Position | ||
| from pyvlx.opening_device import Awning, Blind, GarageDoor, RollerShutter, Window | ||
| from pyvlx.opening_device import Awning, Blind, GarageDoor, Gate, RollerShutter, Window | ||
|
|
||
| from homeassistant.components.cover import ( | ||
| ATTR_POSITION, | ||
|
|
@@ -73,17 +73,19 @@ def current_cover_position(self): | |
|
|
||
| @property | ||
| def device_class(self): | ||
| """Define this cover as either window/blind/awning/shutter.""" | ||
| if isinstance(self.node, Window): | ||
| return "window" | ||
| if isinstance(self.node, Blind): | ||
| return "blind" | ||
| if isinstance(self.node, RollerShutter): | ||
| return "shutter" | ||
| """Define this cover as either awning, blind, garage, gate, shutter or window.""" | ||
| if isinstance(self.node, Awning): | ||
| return "awning" | ||
| if isinstance(self.node, Blind): | ||
| return "blind" | ||
| if isinstance(self.node, GarageDoor): | ||
| return "garage" | ||
| if isinstance(self.node, Gate): | ||
| return "gate" | ||
| if isinstance(self.node, RollerShutter): | ||
| return "shutter" | ||
| if isinstance(self.node, Window): | ||
| return "window" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. btw, do you have any idea, why the velux windows are shown as shutters in apple home. (which has the effect, that all windows open, when you say "hey siri, open the shutters". :-) )
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm sorry, I don't know. I'm not quite there yet in my integration. I will definitely have a look at it, because I have Somfy roller shutters as well as Velux windows :-) |
||
| return "window" | ||
|
|
||
| @property | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are constants in the cover entity integration for the valid device classes. Please import and use those here.
core/homeassistant/components/cover/__init__.py
Lines 43 to 52 in 4dcff29