'Set new operation mode.'

def set_operation_mode(self, operation_mode):

    device = self._cubehandle.cube.device_by_rf(self._rf_address)
    mode = self.map_mode_hass_max(operation_mode)
    if (mode is None):
        return False
    with self._cubehandle.mutex:
        try:
            self._cubehandle.cube.set_mode(device, mode)
        except (socket.timeout, socket.error):
            _LOGGER.error('Setting    operation    mode    failed')
            return False
