Fix Tahoma device class (#11745)

* fix device class

* edit description
This commit is contained in:
Thijs de Jong 2018-01-18 06:20:23 +01:00 committed by Paulus Schoutsen
parent e72fefa74d
commit aac01cb096

View file

@ -62,6 +62,14 @@ class TahomaCover(TahomaDevice, CoverDevice):
if self.current_cover_position is not None: if self.current_cover_position is not None:
return self.current_cover_position == 0 return self.current_cover_position == 0
@property
def device_class(self):
"""Return the class of the device."""
if self.tahoma_device.type == 'io:WindowOpenerVeluxIOComponent':
return 'window'
else:
return None
def open_cover(self, **kwargs): def open_cover(self, **kwargs):
"""Open the cover.""" """Open the cover."""
self.apply_action('open') self.apply_action('open')
@ -77,10 +85,3 @@ class TahomaCover(TahomaDevice, CoverDevice):
self.apply_action('setPosition', 'secured') self.apply_action('setPosition', 'secured')
else: else:
self.apply_action('stopIdentify') self.apply_action('stopIdentify')
def device_class(self):
"""Return the class of this device, from component DEVICE_CLASSES."""
if self.tahoma_device.type == 'io:WindowOpenerVeluxIOComponent':
return 'window'
else:
return None