patch stop command (#11612)

This commit is contained in:
Thijs de Jong 2018-01-13 09:06:37 +01:00 committed by Fabian Affolter
parent 7a50450b92
commit d88edb0661
No known key found for this signature in database
GPG key ID: DDF3D6F44AAB1336

View file

@ -15,11 +15,6 @@ DEPENDENCIES = ['tahoma']
_LOGGER = logging.getLogger(__name__)
TAHOMA_STOP_COMMAND = {
'io:RollerShutterWithLowSpeedManagementIOComponent': 'my',
'io:RollerShutterVeluxIOComponent': 'my',
}
SCAN_INTERVAL = timedelta(seconds=60)
@ -78,8 +73,11 @@ class TahomaCover(TahomaDevice, CoverDevice):
def stop_cover(self, **kwargs):
"""Stop the cover."""
self.apply_action(TAHOMA_STOP_COMMAND.get(self.tahoma_device.type,
'stopIdentify'))
if self.tahoma_device.type == \
'io:RollerShutterWithLowSpeedManagementIOComponent':
self.apply_action('setPosition', 'secured')
else:
self.apply_action('stopIdentify')
def device_class(self):
"""Return the class of this device, from component DEVICE_CLASSES."""