Add support for Velux Gates (#34774)

pull/36052/head
mnaggatz 2020-05-23 20:08:02 +02:00 committed by GitHub
parent be854b7363
commit a5caf8576b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 8 deletions

View File

@ -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 @@ class VeluxCover(CoverEntity):
@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"
return "window"
@property