diff --git a/homeassistant/components/cover/tahoma.py b/homeassistant/components/cover/tahoma.py index 2f0362535ca..d492ad50866 100644 --- a/homeassistant/components/cover/tahoma.py +++ b/homeassistant/components/cover/tahoma.py @@ -74,3 +74,10 @@ class TahomaCover(TahomaDevice, CoverDevice): def stop_cover(self, **kwargs): """Stop the cover.""" 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 diff --git a/homeassistant/components/tahoma.py b/homeassistant/components/tahoma.py index 129c6506ac1..c2453d75493 100644 --- a/homeassistant/components/tahoma.py +++ b/homeassistant/components/tahoma.py @@ -36,6 +36,14 @@ TAHOMA_COMPONENTS = [ 'sensor', 'cover' ] +TAHOMA_TYPES = { + 'rts:RollerShutterRTSComponent': 'cover', + 'rts:CurtainRTSComponent': 'cover', + 'io:RollerShutterWithLowSpeedManagementIOComponent': 'cover', + 'io:WindowOpenerVeluxIOComponent': 'cover', + 'io:LightIOSystemSensor': 'sensor', +} + def setup(hass, config): """Activate Tahoma component.""" @@ -68,6 +76,8 @@ def setup(hass, config): if all(ext not in _device.type for ext in exclude): device_type = map_tahoma_device(_device) if device_type is None: + _LOGGER.warning('Unsupported type %s for Tahoma device %s', + _device.type, _device.label) continue hass.data[DOMAIN]['devices'][device_type].append(_device) @@ -78,12 +88,8 @@ def setup(hass, config): def map_tahoma_device(tahoma_device): - """Map tahoma classes to Home Assistant types.""" - if tahoma_device.type.lower().find("shutter") != -1: - return 'cover' - elif tahoma_device.type == 'io:LightIOSystemSensor': - return 'sensor' - return None + """Map Tahoma device types to Home Assistant components.""" + return TAHOMA_TYPES.get(tahoma_device.type) class TahomaDevice(Entity):