mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
Expose specific device_class for Velux covers (#24279)
* 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
This commit is contained in:
parent
ac788a7ee7
commit
6d280084fb
@ -60,7 +60,16 @@ class VeluxCover(CoverDevice):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def device_class(self):
|
def device_class(self):
|
||||||
"""Define this cover as a window."""
|
"""Define this cover as either window/blind/awning/shutter."""
|
||||||
|
from pyvlx.opening_device import Blind, RollerShutter, Window, Awning
|
||||||
|
if isinstance(self.node, Window):
|
||||||
|
return 'window'
|
||||||
|
if isinstance(self.node, Blind):
|
||||||
|
return 'blind'
|
||||||
|
if isinstance(self.node, RollerShutter):
|
||||||
|
return 'shutter'
|
||||||
|
if isinstance(self.node, Awning):
|
||||||
|
return 'awning'
|
||||||
return 'window'
|
return 'window'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user